You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flyapps/fir_ser/nginx-vhost.conf

89 lines
2.6 KiB

upstream synchrotron {
least_conn ;
#server 127.0.0.1:8899;
server 127.0.0.1:8898;
#server 127.0.0.1:8897;
#server 127.0.0.1:8896;
}
proxy_set_header X-Forwarded-For $remote_addr;
server
{
listen 80;
listen 443 ssl http2;
server_name fly.dvcloud.xin;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/fly.dvcloud.xin;
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
ssl_certificate /www/server/panel/vhost/cert/fly.dvcloud.xin/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/fly.dvcloud.xin/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497 https://$host$request_uri;
# 如果未开启token 授权,可以启动下面配置,直接让nginx读取资源,无需 uwsgi 进行转发
# location ~ ^/download/ {
# root /data/flyapp/fir_ser/;
# rewrite ^/download/(.*) /files/$1 break;
# }
location ~ ^/(download|api|files|udid|captcha) {
#proxy_pass http://synchrotron;
4 years ago
#proxy_send_timeout 180;
#proxy_connect_timeout 180;
#proxy_read_timeout 180;
4 years ago
uwsgi_send_timeout 300; # 指定向uWSGI传送请求的超时时间,完成握手后向uWSGI传送请求的超时时间。
uwsgi_connect_timeout 300; # 指定连接到后端uWSGI的超时时间。
uwsgi_read_timeout 300; # 指定接收uWSGI应答的超时时间,完成握手后接收uWSGI应答的超时时间。
include uwsgi_params;
uwsgi_pass 127.0.0.1:8899;
uwsgi_param UWSGI_SCRIPT wsgi;
}
location ~ ^/(index|apps|user|login|register|supersign) {
try_files $uri $uri/ /index.html;
}
# location / {
# try_files $uri $uri/ /mshort.html;
# }
location / {
5 years ago
try_files $uri $uri/ /short.html;
}
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
access_log /www/wwwlogs/fly.dvcloud.xin.log;
error_log /www/wwwlogs/fly.dvcloud.xin.error.log;
}