2020-08-03 19:28:39 +02:00
|
|
|
server {
|
|
|
|
listen [::]:80;
|
|
|
|
listen *:80;
|
|
|
|
|
|
|
|
# server_name dev.planet-casio.com;
|
|
|
|
server_name v5.planet-casio.com;
|
2020-08-27 22:45:30 +02:00
|
|
|
|
2020-08-03 19:28:39 +02:00
|
|
|
include common.conf;
|
|
|
|
|
2020-08-27 22:45:30 +02:00
|
|
|
access_log /var/log/nginx/pc-dev_access.log;
|
|
|
|
error_log /var/log/nginx/pc-dev_error.log;
|
2020-08-03 19:28:39 +02:00
|
|
|
|
|
|
|
location / {
|
|
|
|
return 301 https://$server_name$request_uri;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
listen *:443 ssl http2;
|
|
|
|
|
|
|
|
# server_name dev.planet-casio.com;
|
|
|
|
server_name v5.planet-casio.com;
|
2020-08-27 22:45:30 +02:00
|
|
|
|
2020-08-03 19:28:39 +02:00
|
|
|
include common.conf;
|
|
|
|
include ssl.conf;
|
|
|
|
|
|
|
|
ssl_certificate /etc/dehydrated/certs/v5.planet-casio.com/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/dehydrated/certs/v5.planet-casio.com/privkey.pem;
|
|
|
|
|
2020-08-27 22:45:30 +02:00
|
|
|
access_log /var/log/nginx/pc-dev_access.log;
|
|
|
|
error_log /var/log/nginx/pc-dev_error.log;
|
2020-08-03 19:28:39 +02:00
|
|
|
|
|
|
|
root /home/pc-dev/www;
|
|
|
|
|
|
|
|
# Serve files from /static as static files
|
|
|
|
location /static {
|
2020-08-27 22:45:30 +02:00
|
|
|
alias /home/pc-dev/www/app/static;
|
2020-08-03 19:28:39 +02:00
|
|
|
try_files $uri =404;
|
|
|
|
expires 7d;
|
|
|
|
add_header Cache-Control "public";
|
|
|
|
include gzip.conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Serve avatars
|
|
|
|
location /avatar {
|
2020-08-27 22:45:30 +02:00
|
|
|
root /home/pc-dev/data;
|
|
|
|
try_files $uri /avatar/default_avatar.png =404;
|
2020-08-03 19:28:39 +02:00
|
|
|
expires max;
|
|
|
|
add_header Cache-Control "public";
|
|
|
|
include gzip.conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Serve files
|
|
|
|
location /fichiers {
|
2020-08-27 22:45:30 +02:00
|
|
|
alias /home/pc-dev/data/fichiers;
|
2020-08-03 19:28:39 +02:00
|
|
|
try_files $uri =404;
|
|
|
|
expires 7d;
|
|
|
|
add_header Cache-Control "public";
|
|
|
|
include gzip.conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Pass everything else to the application
|
|
|
|
location / {
|
|
|
|
try_files @fake @application;
|
|
|
|
}
|
|
|
|
|
|
|
|
location @application {
|
|
|
|
include uwsgi_params;
|
2020-08-27 22:45:30 +02:00
|
|
|
uwsgi_pass unix:/run/uwsgi.pc-dev/socket;
|
2020-08-03 19:28:39 +02:00
|
|
|
}
|
|
|
|
}
|