nginx setup
This commit is contained in:
1 parent
cc0a86820d
commit
1495ca49ea
7 files changed
+62
-21
No files matched your search
@@ -0,0 +1,45 @@
|
||||
upstream spacerace_server {
|
||||
server server:40080;
|
||||
}
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name spacerace.systems;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
|
||||
|
||||
# location / {
|
||||
# root /srv/spacerace;
|
||||
# index index.html;
|
||||
# try_files $uri $uri/ index.html;
|
||||
# }
|
||||
|
||||
location /api/ {
|
||||
# trailing slash means api will receive url WITHOUT /api
|
||||
proxy_pass http://spacerace_server/;
|
||||
proxy_read_timeout 600s;
|
||||
}
|
||||
|
||||
error_page 404 /;
|
||||
|
||||
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
||||
listen 443 ssl; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/spacerace.systems/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/spacerace.systems/privkey.pem; # managed by Certbot
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||
}
|
||||
|
||||
# http -> https
|
||||
server {
|
||||
server_name spacerace.systems;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
Reference in new issue
Block a user