Last active
February 29, 2020 21:10
-
-
Save lcherone/f86540405e1716c8cca2afaaacfa9ac8 to your computer and use it in GitHub Desktop.
Basic reverse proxy configs.
This file contains 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
<VirtualHost *:80> | |
ServerName example.com | |
ErrorLog /var/log/httpd/example.com-error.log | |
CustomLog /var/log/httpd/example.com-access.log combined | |
ProxyRequests Off | |
ProxyVia Block | |
ProxyPreserveHost On | |
<Proxy *> | |
Require all granted | |
</Proxy> | |
ProxyPass / http://localhost:8080/ | |
ProxyPassReverse / http://localhost:8080/ | |
</VirtualHost> |
This file contains 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
example.com | |
proxy / localhost:8080 { | |
header_upstream X-Forwarded-Proto {scheme} | |
header_upstream X-Forwarded-Host {host} | |
header_upstream Host {host} | |
} |
This file contains 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
server { | |
listen 80; | |
server_name example.com; | |
# To allow special characters in headers | |
ignore_invalid_headers off; | |
# Allow any size file to be uploaded. | |
# Set to a value such as 1000m; to restrict file size to a specific value | |
client_max_body_size 0; | |
# To disable buffering | |
proxy_buffering off; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_connect_timeout 300; | |
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1 | |
proxy_http_version 1.1; | |
proxy_set_header Connection ""; | |
proxy_pass http://localhost:8080; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment