8080.conf 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. server {
  2. listen 8080 ssl;
  3. listen [::]:8080 ssl;
  4. server_name localhost;
  5. index index.php index.html index.htm default.php default.htm default.html;
  6. root /app/www/wwwroot/www.valuesys1.com/web;
  7. ssl_certificate ssl/server.crt;
  8. ssl_certificate_key ssl/server.key;
  9. ssl_session_timeout 1h;
  10. #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  11. ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
  12. ssl_protocols TLSv1.2 TLSv1.3;
  13. ssl_prefer_server_ciphers on;
  14. server_tokens off;
  15. proxy_hide_header X-Powered-By;
  16. add_header X-Powered-By "";
  17. proxy_hide_header Server;
  18. add_header X-Frame-Options "SAMEORIGIN";
  19. add_header X-XSS-Protection "1; mode=block";
  20. add_header X-Content-Type-Options "nosniff";
  21. add_header Set-Cookie "Path=/; HttpOnly; Secure";
  22. #车辆系统
  23. #PHP-INFO-START PHP引用配置,可以注释或修改
  24. location ~ [^/]\.php(/|$)
  25. {
  26. try_files $uri =404;
  27. fastcgi_pass 127.0.0.1:9000;
  28. fastcgi_index index.php;
  29. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  30. fastcgi_param QUERY_STRING $query_string;
  31. fastcgi_param REQUEST_METHOD $request_method;
  32. fastcgi_param CONTENT_TYPE $content_type;
  33. fastcgi_param CONTENT_LENGTH $content_length;
  34. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  35. fastcgi_param REQUEST_URI $request_uri;
  36. fastcgi_param DOCUMENT_URI $document_uri;
  37. fastcgi_param DOCUMENT_ROOT $document_root;
  38. fastcgi_param SERVER_PROTOCOL $server_protocol;
  39. fastcgi_param REQUEST_SCHEME $scheme;
  40. fastcgi_param HTTPS $https if_not_empty;
  41. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  42. fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  43. fastcgi_param REMOTE_ADDR $remote_addr;
  44. fastcgi_param REMOTE_PORT $remote_port;
  45. fastcgi_param SERVER_ADDR $server_addr;
  46. fastcgi_param SERVER_PORT $server_port;
  47. fastcgi_param SERVER_NAME $server_name;
  48. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  49. fastcgi_param REDIRECT_STATUS 200;
  50. set $real_script_name $fastcgi_script_name;
  51. if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
  52. set $real_script_name $1;
  53. set $path_info $2;
  54. }
  55. fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
  56. fastcgi_param SCRIPT_NAME $real_script_name;
  57. fastcgi_param PATH_INFO $path_info;
  58. }
  59. #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  60. location ~* (runtime|application)/{
  61. return 403;
  62. }
  63. #location /house-car/car/ {
  64. # if (!-e $request_filename){
  65. # rewrite ^(.*)$ /index.php?s=$1 last; break;
  66. # }
  67. #}
  68. location / {
  69. if (!-e $request_filename){
  70. #rewrite ^/house-car/car/(.*)$ /index.php?s=$1 last; break;
  71. rewrite ^(.*)$ /index.php?s=$1 last; break;
  72. }
  73. }
  74. #REWRITE-END
  75. #禁止访问的文件或目录
  76. location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  77. {
  78. return 404;
  79. }
  80. #一键申请SSL证书验证目录相关设置
  81. location ~ \.well-known{
  82. allow all;
  83. }
  84. #禁止在证书验证目录放入敏感文件
  85. if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  86. return 403;
  87. }
  88. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  89. {
  90. expires 30d;
  91. error_log /dev/null;
  92. access_log /dev/null;
  93. }
  94. location ~ .*\.(js|css)?$
  95. {
  96. expires 12h;
  97. error_log /dev/null;
  98. access_log /dev/null;
  99. }
  100. access_log /app/www/wwwlogs/www.valuesys1.com.log;
  101. error_log /app/www/wwwlogs/www.valuesys1.com.error.log;
  102. #location /house-car/car/car/ {
  103. # proxy_redirect off;
  104. # proxy_set_header Host $host:$server_port;
  105. # proxy_set_header X-Real-IP $remote_addr;
  106. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  107. # proxy_pass http://127.0.0.1:39080/car/;
  108. # }
  109. #location /house-car/car/assets/ {
  110. # add_header Access-Control-Allow-Origin '*' always;
  111. # add_header Access-Control-Allow-Headers '*';
  112. # add_header Access-Control-Allow-Methods '*';
  113. # add_header Access-Control-Allow-Credentials 'false';
  114. # if ($request_method = 'OPTIONS') {
  115. # return 204;
  116. # }
  117. # proxy_redirect off;
  118. # proxy_set_header Host $host:$server_port;
  119. # proxy_set_header X-Real-IP $remote_addr;
  120. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  121. #
  122. # proxy_pass http://127.0.0.1:39080/assets/;
  123. # }
  124. #error_page 404 /404.html;
  125. # redirect server error pages to the static page /50x.html
  126. #
  127. error_page 500 502 503 504 /50x.html;
  128. location = /50x.html {
  129. root /usr/share/nginx/html;
  130. }
  131. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  132. #
  133. #location ~ \.php$ {
  134. # proxy_pass http://127.0.0.1;
  135. #}
  136. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  137. #
  138. #location ~ \.php$ {
  139. # root html;
  140. # fastcgi_pass 127.0.0.1:9000;
  141. # fastcgi_index index.php;
  142. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  143. # include fastcgi_params;
  144. #}
  145. # deny access to .htaccess files, if Apache's document root
  146. # concurs with nginx's one
  147. #
  148. #location ~ /\.ht {
  149. # deny all;
  150. #}
  151. }