mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
51 lines
No EOL
1.8 KiB
Text
51 lines
No EOL
1.8 KiB
Text
# This will load balance your backend to one or more destinations.
|
|
upstream backend {
|
|
# server api1.my.uxbox.com:3000;
|
|
# server api1.my.uxbox.com:3001;
|
|
# server api2.my.uxbox.com:3000;
|
|
server uxbox_backend:6060; # This is a circular reference that allows docker to start as the example project, it is not recommended to use this in actual development.
|
|
}
|
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
#listen 443 ssl http2 default_server;
|
|
#listen [::]:443 ssl http2 default_server;
|
|
|
|
#ssl_certificate /etc/nginx/keys/server.crt;
|
|
#ssl_certificate_key /etc/nginx/keys/server.key;
|
|
|
|
#ssl on;
|
|
#ssl_session_cache builtin:1000 shared:SSL:10m;
|
|
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
#ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
|
|
#ssl_prefer_server_ciphers on;
|
|
|
|
# Reverse Proxy to Backend (Avoids XSS concerns) --Update api to be whatever your site uses to access your backend
|
|
location /api/ {
|
|
proxy_pass http://backend;
|
|
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 X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
# IMPORTANT: Update my.uxbox.com to your production site. This will allow cookies to work as expected when using your deployment locally
|
|
proxy_cookie_domain localhost my.uxbox.com;
|
|
}
|
|
|
|
# Application
|
|
location / {
|
|
root /usr/share/nginx/html/;
|
|
|
|
try_files $uri /index.html;
|
|
gzip on;
|
|
gzip_types text/css text/javascript application/x-javascript application/javascript application/json;
|
|
|
|
add_header Cache-Control "max-age=15552000" always;
|
|
}
|
|
} |