ngnix显示页面未找到

时间:2019-02-08 15:32:35

标签: php apache .htaccess nginx

我正在尝试将.htaccess转换为nginx.conf,但是我得到了404 Not Found ngnix / 1.14.1。我用过wingix,这里是否缺少某些东西?

enter image description here

我想念的是谁能帮助我?

# nginx configuration 

error_page 404 https://www.address.com/sources/not-found.php; 
location / { 
   if ($request_method !~ "POST") { 
      rewrite ^(.*)$ /%1 redirect; 
   } 
   if ($request_method !~ "POST") { 
      rewrite ^/(.*)index\.php$ /$1 redirect; 
   } 
   if (-e $request_filename){ 
      rewrite ^/status/([\w-]+)/?$ /status.php?msgID=$1 break; 
   } 
    rewrite ^/(.+?)/?$ /$1.php break; 
} 

location /hashtag { 
    rewrite ^/hashtag/([^/]+)/?$ /hashtags.php?tag=$1 break; 
} 

location /settings { 
    rewrite ^/settings/([\w-]+)/?$ /settings.php?set=$1 break; 
} 

location /account { 
    rewrite ^/account/([\w-]+)/?$ /sources/index.php?get=$1 break;
} 

location /dashboard { 
    rewrite ^/dashboard/([\w-]+)/?$ /admin/index.php?set=$1 break; 
} 

location /profile { 
    rewrite ^/profile/([^/]+)/?$ /profile.php?username=$1 break; 
    rewrite ^/profile/(followers|friends|saved)/([^/]+)/?$ /$1.php?username=$2 break; 
}

0 个答案:

没有答案