ホームページ > バックエンド開発 > PHPチュートリアル > nginx サーバー設定 pathinfo モード (dolphin php バックグラウンドでの無制限のリダイレクトの問題を解決します)

nginx サーバー設定 pathinfo モード (dolphin php バックグラウンドでの無制限のリダイレクトの問題を解決します)

不言
リリース: 2023-03-24 09:02:01
オリジナル
2495 人が閲覧しました

这篇文章主要介绍了nginx服务器配置pathinfo模式(解决海豚php后台无限重定向问题)  ,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

server {

  listen 80;

  server_name www.yxk.cn yxk.cn;

  access_log /data/wwwlogs/www.yxk.cn_nginx.log combined;

  index index.html index.htm index.php;

  root /data/wwwroot/www.yxk.cn/public;

  if ($host != www.yxk.cn) {  return 301 $scheme://www.yxk.cn$request_uri;  }

  include /usr/local/nginx/conf/rewrite/thinkphp.conf;

  #error_page 404 /404.html;

  #error_page 502 /502.html;

   

  location ~ [^/]\.php(/|$){

    fastcgi_pass unix:/dev/shm/php-cgi.sock;

    fastcgi_index index.php;

    fastcgi_split_path_info ^(.+\.php)(.*)$;

    fastcgi_param PATH_INFO $fastcgi_path_info;

    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

    include fastcgi_params;

    #include fastcgi.conf;

    #include pathinfo.conf;

  }

 

  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {

    expires 30d;

    access_log off;

  }

  location ~ .*\.(js|css)?$ {

    expires 7d;

    access_log off;

  }

  location ~ /\.ht {

    deny all;

  }

}

 

thinkphp.conf文件内容:

location / {

  if (!-e $request_filename) {

    rewrite ^(.*)$ /index.php?s=/$1 last;

    break;

  }

}

ログイン後にコピー

相关推荐:

php Nginx服务器配置支持pathinfo


以上がnginx サーバー設定 pathinfo モード (dolphin php バックグラウンドでの無制限のリダイレクトの問題を解決します)の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

関連ラベル:
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート