comixify/nginx.conf

56 lines
1.2 KiB
Nginx Configuration File
Raw Permalink Normal View History

2018-07-31 19:51:39 +00:00
upstream hello_server {
2018-08-26 20:35:31 +00:00
server web:8008;
2018-12-13 09:08:40 +00:00
# server 35.195.198.74:80;
server 35.233.41.32:80;
2018-07-31 19:51:39 +00:00
}
2018-09-25 09:14:44 +00:00
server {
listen 80;
server_name localhost;
return 301 https://$host$request_uri;
}
2018-07-31 19:51:39 +00:00
server {
2018-09-25 09:14:44 +00:00
listen 443;
server_name localhost;
client_max_body_size 50M;
ssl on;
ssl_certificate /etc/letsencrypt/live/comixify.ii.pw.edu.pl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/comixify.ii.pw.edu.pl/privkey.pem;
2018-07-31 19:51:39 +00:00
location / {
# everything is passed to Gunicorn
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
2018-08-27 22:15:49 +00:00
proxy_pass http://hello_server;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
2018-07-31 19:51:39 +00:00
}
2018-12-13 09:08:40 +00:00
location = / {
proxy_pass http://35.195.198.74:80$uri;
}
2018-09-25 09:14:44 +00:00
location ^~ /.well-known {
allow all;
root /data/letsencrypt/;
}
2018-12-13 09:08:40 +00:00
2018-07-31 19:51:39 +00:00
location /static/ {
alias /comixify/static/;
2018-12-13 09:08:40 +00:00
try_files $uri = @try_another2;
2018-07-31 19:51:39 +00:00
}
location /media/ {
alias /comixify/media/;
2018-12-13 09:08:40 +00:00
try_files $uri = @try_another2;
2018-07-31 19:51:39 +00:00
}
2018-12-13 09:08:40 +00:00
location @try_another2 {
proxy_pass http://35.233.41.32:80$uri;
}
2018-09-25 09:14:44 +00:00
}