本帖最后由 赫兹梓籽 于 2022-7-30 19:56 编辑
求助论坛各位大佬,网站不知道为什么用了cdn后一直说重定向过多 这是nginx配置
- server
- {
- listen 80; #listen end
- server_name xxxx.com; #server_name end
- index index.html index.htm index.php; #index end
-
- set $subdomain ”;
- root /home/wwwroot/php7/domain/bbs.xxxx.site/web$subdomain;
- return 301 https://$host$request_uri; #force_ssl end
- include /home/wwwroot/php7/rewrite/xiuno.conf; #rewrite end
-
- #error_page
- error_page 400 /ErrorPages/400.html;
- error_page 403 /ErrorPages/403.html;
- error_page 404 /ErrorPages/404.html;
- error_page 502 /ErrorPages/502.html;
- location ~ /ErrorPages/(400|401|403|404|405|502|503).html$
- {
- root /home/wwwroot/php7/domain/bbs.xxxxxi.site/web;
- }
-
-
- location ~ .*.php$
- {
- fastcgi_pass unix:/tmp/php-cgi-php7-bbs.xxxx.site.sock;
- fastcgi_index index.php;
- include fcgi.conf;
- fastcgi_param DOCUMENT_ROOT /home/wwwroot/php7/domain/bbs.xxxx.site/web$subdomain;
- fastcgi_param SCRIPT_FILENAME /home/wwwroot/php7/domain/bbs.xxxx.site/web$subdomain$fastcgi_script_name;
- }
-
- location ~ .*.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$
- {
- expires 30d;
- }
-
- location ~ .*.(js|css)$
- {
- expires 12h;
- }
-
- location ~* .(htm)$ {
-
- rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
-
- }
-
- access_log off; #access_log end
- error_log /dev/null; #error_log end
- }
复制代码
这是伪静态配置:
- location ~* .(htm)$ {
-
- rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
-
- }
复制代码
谢谢各位大佬了 |