E
E
Eduard Valeev2019-04-07 15:06:42
Nginx
Eduard Valeev, 2019-04-07 15:06:42

How to set up nginx in laragon?

On my server, the site runs under FastCGI (Nginx + PHP-FPM) and in the ispmanager shell.
I decided to raise a copy of the site on the local machine.
I installed the laragon web server, installed the site (CMS wordpress) and the main page opened. But internal pages give 404 error.
It turns out that in order for WP sites running under nginx to open internal pages normally, you need to write the following lines in the nginx settings in the server{} block:

location / {
    location ~ [^/]\.ph(p\d*|tml)$ {
      try_files /does_not_exists @php;
    }
      try_files $uri $uri/ /index.php?$args;
  }

And it works if you set up ngingx in the ispanager environment.
But it is not clear to me where to register this (or where the config is located) in the Laragon web server.
Tell me please :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
antimind, 2019-04-07
@Adward

Here's what the documentation says:

{LARAGON_ROOT}\etc\nginx\sites-enabled\auto.{project}.test.conf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question