Created
September 26, 2016 06:26
-
-
Save Samorai/65eb4b9ed31627a274be8c35f439ee38 to your computer and use it in GitHub Desktop.
Nginx:proxy configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^/api/(?<api_path>.*)$ { | |
set $proxy_host_name "127.0.0.1"; | |
set $proxy_api_path ":8080/rest-service-1/api/"; | |
set $proxy_host_scheme "http"; | |
resolver 8.8.8.8; | |
proxy_set_header Host $proxy_host_name; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Scheme $scheme; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_pass $proxy_host_scheme://$proxy_host_name$proxy_api_path$api_path?$query_string; | |
proxy_redirect off; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment