nginx别名php 403

时间:2018-11-16 01:09:17

标签: php nginx alias

我的webroot是/ web / zjz,我想使用http://new.ahsl.gov.cn/zjz/浏览,但是响应403,我不知道错误在哪里,请帮助我,谢谢 nginx的配置是:

server {
    listen       80;
    server_name  new.ahsl.gov.cn www.ahsl.gov.cn;

    access_log  /var/log/nginx/www.test.gov.cn_access.log  main;
    root   /web/master;

    location ^~ /zjz/ {
        alias /web/zjz;

        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /web/zjz/$fastcgi_script_name;
                include        fastcgi_params;
            }
    }

    location / {
        index  index.html index.htm index.php;
    include /web/master/.htaccess;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location ~ \.(jpg|png|gif)$ {
        expires 1h;
        gzip on;
    }
}

0 个答案:

没有答案