|
|
@@ -0,0 +1,45 @@
|
|
|
+# 将HTTP请求重定向到HTTPS
|
|
|
+server {
|
|
|
+ listen 80;
|
|
|
+ server_name test-hairstylist.aitori.jp;
|
|
|
+ return 301 https://$server_name$request_uri;
|
|
|
+}
|
|
|
+
|
|
|
+# 配置HTTPS
|
|
|
+server {
|
|
|
+ listen 443 ssl;
|
|
|
+ server_name test-hairstylist.aitori.jp;
|
|
|
+
|
|
|
+ # SSL证书和密钥文件
|
|
|
+ ssl_certificate cert/test-hairstylist.aitori.jp.pem;
|
|
|
+ ssl_certificate_key cert/test-hairstylist.aitori.jp.key;
|
|
|
+
|
|
|
+ # SSL配置
|
|
|
+ ssl_session_timeout 5m;
|
|
|
+ ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!aNULL:!MD5:!ADH:!RC4;
|
|
|
+ ssl_protocols TLSv1.2 TLSv1.3;
|
|
|
+ ssl_prefer_server_ciphers on;
|
|
|
+
|
|
|
+ root /data/www/bi/html;
|
|
|
+ index index.html;
|
|
|
+
|
|
|
+ # location 配置
|
|
|
+ location ^~ /api/ {
|
|
|
+ proxy_pass http://127.0.0.1:3000;
|
|
|
+ proxy_set_header Host $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;
|
|
|
+ }
|
|
|
+
|
|
|
+ location / {
|
|
|
+ try_files $uri $uri/ /index.html;
|
|
|
+ }
|
|
|
+
|
|
|
+ # 错误页面配置
|
|
|
+ error_page 404 /404.html;
|
|
|
+ location = /40x.html { }
|
|
|
+
|
|
|
+ error_page 500 502 503 504 /50x.html;
|
|
|
+ location = /50x.html { }
|
|
|
+}
|