asp.net core obtains the real client ip under Nginx+Docker deployment mode

scene The online environment uses nginx (installed on the host) + Docker for deployment. The IP address of the client obtained by the application is incorrect. The code to obtain the IP address of the client is Request.HttpContext.Connection.RemoteIpAddress.MapToIPv4() Process restore Build a sample environment of webapi Create a new project do ...

Posted on Sat, 16 Nov 2019 16:19:22 -0500 by mtorbin

Using Baidu ai to realize text and picture audit

Before the platform content release audit, we built a set of prohibited thesaurus by ourselves. In the code, we use thesaurus to judge the content published by users. Now we can use Baidu ai api to complete this function. Let's talk about how to do it First, open Baidu ai development platform to register an account: Register account and enter ...

Posted on Fri, 15 Nov 2019 13:08:27 -0500 by dbakker

004.Kubernetes binary deployment creation certificate

Create CA certificate and key 1.1 install cfssl Toolset 1 [root@k8smaster01 ~]# mkdir -p /opt/k8s/cert 2 3 [root@k8smaster01 ~]# curl -L https://Pkg.cfssl.org/r1.2/cfssl ﹣ linux-amd64 - O / opt / k8s / bin / cfssl ᦇ download cfssl software 4 [root@k8smaster01 ~]# curl -L https://Pkg.cfssl.org/r1.2/cfssl json ﹐ linux-amd64 - O / opt ...

Posted on Fri, 15 Nov 2019 09:38:42 -0500 by Andy82

nginx depth optimization - Hide version number, log split, cache processing

Main points: Hide version number Web Cache Log Split Hide version number Two configurations: Modify Profile Method Modify Source Code Method 1. Modify the Profile Law: [root@localhost init.d]# curl -I http://192.168.13.140/ ##View Nginx information HTTP/1.1 200 OK Server: nginx/1.12.2    ##Display version number Date: Tue, 12 Nov 2019 14: ...

Posted on Thu, 14 Nov 2019 16:21:01 -0500 by mapexdrum

Flask series building Swagger UI style web API

Explain Operating system: Windows 10 Python version: 3.7x Virtual Environment Manager: virtualenv Code editor: VS Code Experiment Environment initialization # Create project directory mkdir helloworld cd helloworld # Create a virtual environment python -m virtualenv venv # Activate virtual environment venv\Scripts\activate # Install enviro ...

Posted on Sun, 10 Nov 2019 15:36:40 -0500 by Spoiler

Tornado 6 and python 3.7 asynchronous new posture

No more nonsense, just code __auth__ = "aleimu" __doc__ = "Study tornado6.0+ Version and python3.7+" import time import asyncio import tornado.gen import tornado.web import tornado.ioloop import tornado.httpserver # HTTP server implementation of tornado from tornado.options import define, options from tornado.httpclient import HTTPClient, Asy ...

Posted on Sun, 10 Nov 2019 14:11:46 -0500 by dodginess

Using sentry in hyperf

sentry document: https://docs.sentry.io/ After being familiar with the exception catching mechanism of the hyperf architecture, I think sentry can be used in the exception catching mechanism in a very reasonable way. First install sentry: composer require sentry/sdk:2.0.3 Add in the hyperf.php file after installation Sentry\init(\['dsn' => ' ...

Posted on Sun, 10 Nov 2019 14:03:04 -0500 by homchz

Talk about RequestLogger of Elasticsearch RestClient

order This paper focuses on the RequestLogger of Elasticsearch RestClient RequestLogger elasticsearch-7.0.1/client/rest/src/main/java/org/elasticsearch/client/RequestLogger.java final class RequestLogger { private static final Log tracer = LogFactory.getLog("tracer"); private RequestLogger() { } /** * Logs a request that ...

Posted on Sat, 09 Nov 2019 11:49:41 -0500 by bluestar

Using Spring Security in the RESTful API

introduce In this article, we'll learn how to use Spring and Spring Security 5 to provide a more secure RESTful API. We will use the Java configuration to set security and authenticate using the login and Cookie methods. Enable Spring Security The architecture of Spring Security is entirely based on Servlet filters. The easiest option to regist ...

Posted on Fri, 08 Nov 2019 23:01:42 -0500 by jikishlove

Microsoft's distributed application framework Dapr Helloworld

Dapr HelloWorld <a name="XMoC2"></a> Dapr Distributed Application Runtime. An event-driven, portable runtime for building microservices on cloud and edge. Distributed application runtime, event driven, and portable runtime for cloud and edge microservices. I don't know much now. <a name="MCBci"></a> dapr/dapr GitHub D ...

Posted on Wed, 06 Nov 2019 06:50:22 -0500 by reneeshtk