Created
October 10, 2017 20:46
-
-
Save alincc/c05cac61347803f65014dbd10990d3cd to your computer and use it in GitHub Desktop.
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
| # /etc/nginx/conf.d/site.conf | |
| # Site (port 80 -> 9090) | |
| server { | |
| listen 80; # Listen on port 80 for IPv4 requests | |
| server_name localhost; | |
| access_log /var/log/nginx/site_access.log; | |
| error_log /var/log/nginx/site_error.log; | |
| # Set the root of the static content | |
| root /usr/share/nginx/html; | |
| # Redirect server error pages to the static page /50x.html | |
| error_page 500 502 503 504 /50x.html; | |
| location = /50x.html { | |
| root /usr/share/nginx/html; | |
| } | |
| # Filter static content types and serve from the root | |
| location ~*\.(jpg|jpeg|gif|css|png|js|ico|html)$ { | |
| access_log off; | |
| expires max; | |
| } | |
| # Serve the dynamic content (Site) | |
| location / { | |
| # The application provides its own detailed logs | |
| access_log off; | |
| # Hand over to the application | |
| proxy_pass http://localhost:9090/; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment