73 lines
1.4 KiB
Plaintext
73 lines
1.4 KiB
Plaintext
server {
|
|
listen [::]:80;
|
|
listen *:80;
|
|
|
|
# server_name v5.planet-casio.com;
|
|
server_name www.planet-casio.com;
|
|
|
|
include common.conf;
|
|
|
|
access_log /var/log/nginx/pc_access.log;
|
|
error_log /var/log/nginx/pc_error.log;
|
|
|
|
location / {
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen [::]:443 ssl http2;
|
|
listen *:443 ssl http2;
|
|
|
|
# server_name v5.planet-casio.com;
|
|
server_name www.planet-casio.com;
|
|
|
|
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;
|
|
|
|
access_log /var/log/nginx/pc_access.log;
|
|
error_log /var/log/nginx/pc_error.log;
|
|
|
|
root /home/pc/www;
|
|
|
|
# Serve files from /static as static files
|
|
location /static {
|
|
alias /home/pc/www/app/static;
|
|
try_files $uri =404;
|
|
expires 7d;
|
|
add_header Cache-Control "public";
|
|
include gzip.conf;
|
|
}
|
|
|
|
# Serve avatars
|
|
location /avatar {
|
|
root /home/pc/data;
|
|
try_files $uri /avatar/default_avatar.png =404;
|
|
expires max;
|
|
add_header Cache-Control "public";
|
|
include gzip.conf;
|
|
}
|
|
|
|
# Serve files
|
|
location /fichiers {
|
|
alias /home/pc/data/fichiers;
|
|
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;
|
|
uwsgi_pass unix:/run/uwsgi.pc/socket;
|
|
}
|
|
}
|