Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx error 403 Forbidden #19

Open
detastudio opened this issue Mar 11, 2018 · 1 comment
Open

Nginx error 403 Forbidden #19

detastudio opened this issue Mar 11, 2018 · 1 comment

Comments

@detastudio
Copy link

Helloo im using server nginx n im promplem with error 403 Forbidden.
before im using apache and work.
`
server{
charset utf-8;
client_max_body_size 128M;
listen 85;

root /var/www/html/project/web;
server_name localhost:85 localhost:85;
index index.php;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {            
    try_files $uri $uri/ /index.php?$args;
}

location ~ ^/assets/.*\.php$ {
    deny all;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~* /\. {
    deny all;
}

}`

@execut
Copy link

execut commented May 11, 2019

I solved this problem by comment out this lines:

location ~ ^/assets/.*\.php$ {
    deny all;
}

but it is an unsafe solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants