mirror of
https://github.com/cloudpanel-io/vhost-templates.git
synced 2026-05-18 08:23:31 +08:00
65 lines
1.5 KiB
Plaintext
Executable File
65 lines
1.5 KiB
Plaintext
Executable File
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
{{ssl_certificate_key}}
|
|
{{ssl_certificate}}
|
|
{{server_name}}
|
|
{{root}}
|
|
|
|
{{nginx_access_log}}
|
|
{{nginx_error_log}}
|
|
|
|
if ($scheme != "https") {
|
|
rewrite ^ https://$host$uri permanent;
|
|
}
|
|
|
|
location ~ /.well-known {
|
|
auth_basic off;
|
|
allow all;
|
|
}
|
|
|
|
{{settings}}
|
|
|
|
index index.html;
|
|
|
|
location /uwsgi {
|
|
include uwsgi_params;
|
|
uwsgi_read_timeout 3600;
|
|
#uwsgi_pass unix:///run/uwsgi/app/weblate/socket;
|
|
uwsgi_pass 127.0.0.1:{{app_port}};
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:{{app_port}}/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Server $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
proxy_pass_request_headers on;
|
|
proxy_max_temp_file_size 0;
|
|
proxy_connect_timeout 900;
|
|
proxy_send_timeout 900;
|
|
proxy_read_timeout 900;
|
|
proxy_buffer_size 128k;
|
|
proxy_buffers 4 256k;
|
|
proxy_busy_buffers_size 256k;
|
|
proxy_temp_file_write_size 256k;
|
|
}
|
|
|
|
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
|
|
add_header Access-Control-Allow-Origin "*";
|
|
expires max;
|
|
access_log on;
|
|
}
|
|
|
|
if (-f $request_filename) {
|
|
break;
|
|
}
|
|
} |