Created
April 25, 2020 11:41
-
-
Save anilsakr/7bf9b570b88c3b159d9710860ed51171 to your computer and use it in GitHub Desktop.
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
worker_processes 1; | |
events { | |
worker_connections 4096; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
include /etc/nginx/conf.d/*.conf; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
types_hash_max_size 2048; | |
gzip on; | |
gzip_http_version 1.0; | |
gzip_proxied any; | |
gzip_min_length 500; | |
gzip_disable "MSIE [1-6]\."; | |
gzip_types text/plain text/xml text/css | |
text/comma-separated-values | |
text/javascript | |
application/x-javascript | |
application/atom+xml; | |
default_type application/octet-steam; | |
# Application servers | |
upstream dashboard_server { | |
server 172.31.24.234:8080; | |
} | |
server { | |
rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent; | |
rewrite ^/(.*)/$ /$1 permanent; | |
listen 80; | |
server_name localhost:8080; | |
underscores_in_headers on; | |
return 301 http://localhost:8080$request_uri; | |
} | |
server { | |
index index.html; | |
listen 443 default ssl spdy; | |
server_name localhost:8080; | |
underscores_in_headers on; | |
autoindex off; | |
ssl off; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache builtin:1000 shared:SSL:10m; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_dhparam /etc/nginx/ssl/dhparam2048.pem; | |
ssl_stapling on; | |
ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !RC4 !EXP !PSK !SRP !CAMELLIA !SEED'; | |
add_header Strict-Transport-Security "max-age=31536000;"; | |
keepalive_timeout 70; | |
proxy_set_header Host $host; | |
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_cache_path /tmp/cache keys_zone=one:10m levels=1:2 inactive=60m; | |
Server { | |
listen 80; | |
server_name localhost; | |
location / { | |
proxy_pass http://localhost:8080; | |
proxy_cache one; | |
} | |
} | |
location /edashboard { | |
root /var/www; | |
add_header "Access-Control-Allow-Origin" "*"; | |
add_header Cache-Control "public"; | |
} | |
location = /favicon.ico { | |
alias /var/www/idashboard/favicon.ico; | |
} | |
location / { | |
root /var/www/dashboard.com; | |
add_header "Access-Control-Allow-Origin" "*"; | |
add_header Cache-Control "public"; | |
} | |
# Proxy connections to the application servers | |
location /api/i/v1 { | |
proxy_pass http://dashboard_server; | |
proxy_read_timeout 180; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment