nginx 配置wordpress固定链接

server {
        listen       82;
        #server_name  www.press.com
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        root    "D:/press/wordpress1";
        location / {
            if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
            }
            if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
            }
            if (!-f $request_filename){
                rewrite (.*) /index.php;
            }
            try_files $uri $uri/ /index.html;
            index  index.html index.htm index.php l.php;
            autoindex  off;
        }
        #location /api {
            #proxy_set_header Host $host;
            #proxy_set_header X-Real-IP $remote_addr;
            #proxy_set_header X-Real-PORT $remote_port;
            #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            #proxy_pass http://192.168.0.188:8080/api;
        #}
        location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
        
}

本地配置的信息

你可能感兴趣的:(linux)