Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
qresp/nginx/default.conf
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
55 lines (43 sloc)
1.19 KB
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
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=90r/m; | |
# proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off; | |
upstream gui { | |
server gui:3000; | |
} | |
upstream api { | |
server backend:5000; | |
} | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name _; | |
server_tokens off; | |
gzip on; | |
gzip_proxied any; | |
gzip_comp_level 4; | |
gzip_types text/css application/javascript image/svg+xml; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
# 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; | |
# Define the maximum file size on file uploads | |
client_max_body_size 5M; | |
client_body_buffer_size 5M; | |
ssl_certificate "/etc/certs/nginx.crt"; | |
ssl_certificate_key "/etc/certs/nginx.key"; | |
limit_req zone=mylimit burst=60 nodelay; | |
location /api { | |
proxy_pass http://api; | |
} | |
location / { | |
proxy_pass http://gui; | |
} | |
} |