Answer the question
In order to leave comments, you need to log in
Make Symfony and nginx friends?
After enabling the configuration from here , almost everything worked, except for restricting access to the admin panel located at site_name/admin.
In Apache this is implemented via admin/.htaccess:
AuthType Basic
AuthName "Restricted access"
AuthUserFile /etc/httpd/htpasswd/sitename
Require user admin manager
Order Deny,Allow
Deny from all
Allow from 192.168.0.0/24
location /admin {
rewrite ^(.*) /admin/index.php$1 last;
allow 192.168.0.0/24;
deny all;
}
Answer the question
In order to leave comments, you need to log in
In a good way, the config from the link above needs to be rewritten taking into account the recommendations from here - wiki.nginx.org/Pitfalls
In this case, you do not need to specify anything in location /admin except, in fact, the access settings.
I would still rewrite this part
location ~ \.php$ {
try_files $uri index.php;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param QUERY_STRING $args;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question