猿问

nginx 反向代理到iis

目前问题是不管访问哪个页面,显示内容都是首页,只有地址栏的链接在变

下面是我的配置截图,

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|mp4|doc|docx|ppt|pptx|xls|xlsx)$ {
    #expires 10d;
    proxy_pass http://http://127.0.0.1:8081;}

location / {
    try_files $uri $uri/ /index.php$is_args$args;
    autoindex on;

}



location /app/ {    if (!-e $request_filename){
        rewrite  ^/app/(.*)$  /app/public/index.php?s=/$1  last;        break;
    }
}
#rewrite ^/(.*)$ /index.php/$1 last;
location ~ \.php$ {
    proxy_pass http://127.0.0.1:8888;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header Cookie $http_cookie;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;

    #include snippets/fastcgi-php.conf; 
    #fastcgi_pass php_upstream;        
    #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}


吃鸡游戏
浏览 1667回答 1
1回答

汪汪一只猫

location / {    try_files $uri $uri/ /index.php$is_args$args;    autoindex on; }这里的/index.php$is_args$args,把$uri丢掉了,所以访问只有首页。
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答