You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
torrents-csv-server/docker/prod/nginx.conf

56 lines
1.6 KiB
Nginx Configuration File

worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream torrents-csv {
server "torrents-csv:8902";
}
upstream torrents-csv-ui-perseus {
server "torrents-csv-ui-perseus:8080";
}
server {
# this is the port inside docker, not the public one yet
listen 8904;
# change if needed, this is facing the public web
server_name localhost;
server_tokens off;
gzip on;
gzip_types text/css application/javascript image/svg+xml;
gzip_vary on;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
# frontend general requests
location / {
set $proxpass "http://torrents-csv-ui-perseus";
proxy_pass $proxpass;
rewrite ^(.+)/+$ $1 permanent;
# Send actual client IP upstream
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# backend
location ~ ^/(service) {
proxy_pass "http://torrents-csv";
# proxy common stuff
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Send actual client IP upstream
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}