Answer the question
In order to leave comments, you need to log in
Nginx configuration - all requests only to index.php, how?
Hi all!
There is a service on php only backend. Work happens only through index.php.
Here is the config:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www;
index.php;
server_name _;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
location / {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
Answer the question
In order to leave comments, you need to log in
For example like this:
location / {
rewrite ^ /index.php break;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question