首页
仓库
文档
nginx手册
Docker手册
workerman
Flask
PHP
python
RabbitMQ
其他
Linux
占位1
占位2
目录
``` location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1; } } location ~ \.php { #fastcgi_pass remote_php_ip:9000; fastcgi_pass 127.0.0.1:20054; fastcgi_index index.php; include fastcgi_params; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } ``` 完整 ``` server { listen 80; listen 443 ssl; server_name 666.www.cn; index index.php index.html index.htm default.php default.htm default.html; root D:/wwwroot/666.www.cn; ssl_certificate_key 666/666.www.cn.key; ssl_certificate 666/666.www.cn_bundle.crt; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; #START-ERROR-PAGE #error_page 403 /403.html; # error_page 404 /404.html; #error_page 502 /502.html; #END-ERROR-PAGE #HTTP_TO_HTTPS_START #HTTP_TO_HTTPS_END #LIMIT_INFO_START #LIMIT_INFO_END #SSL-INFO-START #SSL-INFO-END #=========================== #================ #反代清理缓存配置 location ~ /purge(/.*) { # proxy_cache_purge cache_one $1$is_args$args; } #proxy 反向代理 # include proxy/ymwxzs.hkankan.cn/*.conf; #PHP-INFO-START location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1; } } location ~ \.php { #fastcgi_pass remote_php_ip:9000; fastcgi_pass 127.0.0.1:20054; fastcgi_index index.php; include fastcgi_params; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } #PHP-INFO-END #REWRITE-START include rewrite/666.www.cn/*.conf; #REWRITE-END #redirect 重定向 include redirect/666.www.cn/*.conf; #禁止访问的文件或目录 location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md) { return 404; } #一键申请SSL证书验证目录相关设置 location ~ \.well-known{ allow all; } access_log D:/BtSoft/wwwlogs/666.www.cn.log; error_log D:/BtSoft/wwwlogs/666.www.cn.error.log; } ```