Redirect on x-forwarded-for=http in echoserver.

This commit is contained in:
Prashanth Balasubramanian 2016-03-08 11:03:45 -08:00
parent 98f03b789a
commit 4409bed106
4 changed files with 13 additions and 4 deletions

View file

@ -11,10 +11,16 @@ http {
server {
# please check the benefits of reuseport https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1
# basically instructs to create an individual listening socket for each worker process (using the SO_REUSEPORT
# basically instructs to create an individual listening socket for each worker process (using the SO_REUSEPORT
# socket option), allowing a kernel to distribute incoming connections between worker processes.
listen 8080 default_server reuseport;
# Replace '_' with your hostname.
server_name _;
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
location / {
lua_need_request_body on;
content_by_lua_block {