Created
August 17, 2017 12:00
-
-
Save sergeioff/36012edb04e262145fdf9a11724337d6 to your computer and use it in GitHub Desktop.
working nginx config
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
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# | |
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. | |
## | |
# Default server configuration | |
# | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
error_log /var/log/nginx/error_debug.log debug; | |
# SSL configuration | |
# | |
# listen 443 ssl default_server; | |
# listen [::]:443 ssl default_server; | |
# | |
# Note: You should disable gzip for SSL traffic. | |
# See: https://bugs.debian.org/773332 | |
# | |
# Read up on ssl_ciphers to ensure a secure configuration. | |
# See: https://bugs.debian.org/765782 | |
# | |
# Self signed certs generated by the ssl-cert package | |
# Don't use them in a production server! | |
# | |
# include snippets/snakeoil.conf; | |
root /var/www/html/; | |
# Add index.php to the list if you are using PHP | |
index index.html index.htm index.nginx-debian.html; | |
server_name _; | |
location ~ /assets/(.*) { | |
try_files $uri $uri/ /ui/assets/$1; | |
} | |
location ~ ^\/ui.+?([^\/]+(\.js|svg|eot|ico|woff2|ttf|woff|map$)) { | |
try_files $uri $uri/ /ui/$1; | |
} | |
location ~ ^/(?!ui|deprecated_ui).* { | |
proxy_pass http://127.0.0.1:8080/$uri?$args&remote_client_address=$remote_addr&country=$geoip_country_code; | |
} | |
location ~ ^/ui.* { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
expires -1; | |
add_header Pragma "no-cache"; | |
add_header Cache-Control "no-store, no-cache, must-revalicate, post-check=0 pre-check=0"; | |
try_files $uri $uri/ /ui/index.html; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment