From baf46ae8163eb75791418c741782cb128e5a0cdf Mon Sep 17 00:00:00 2001 From: chunzhi Date: Thu, 29 Feb 2024 22:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20nginx.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..996653b --- /dev/null +++ b/nginx.conf @@ -0,0 +1,37 @@ +server { + listen 80; + listen [::]:80; #这里的IPV6地址根据情况可以不写 + server_name example.com; #域名 + if ($scheme = http) { #强制跳转https + return 301 https://$server_name$request_uri; + } +} +server { + listen 443 ssl; + access_log /var/log/nginx/vpn_access.log main; #指定访问日志 + error_log /var/log/nginx/vpn_error.log error; #指定错误日志 + server_name example.com; + + ssl_certificate /ssl/cert.pem; #证书路径 + ssl_certificate_key /ssl/cert.key; #证书路径 + + ssl_session_cache shared:SSL:1m; + ssl_session_timeout 5m; + + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + location / { + root /vpn/SSPanel-Uim/public; #网页目录 + index index.html index.htm index.php; + try_files $uri /index.php$is_args$args; + } + location ~ \.php$ { + root /vpn/SSPanel-Uim/public; #网页目录 + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + include fastcgi_params; + } +} \ No newline at end of file