Answer the question
In order to leave comments, you need to log in
Why is nginx giving 403 error in my case?
Config:
server {
server_name rates.test www.rates.test;
# listen *:443 default_server;
root /var/www/rates/backend/web;
index index.php;
charset utf-8;
client_max_body_size 20M;
access_log /var/log/nginx/rates.test.access.log;
error_log /var/log/nginx/rates.test.error.log;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
location ~ \.php$ {
add_header X-Frame-Options $x_frame_options;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
try_files $uri =404;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question