Welcome! Log In Create A New Profile

Advanced

Re: Nginx php reverse proxy problem

Francis Daly
February 18, 2020 06:38PM
On Wed, Feb 12, 2020 at 07:43:11AM -0500, adrian.hilt wrote:

Hi there,

> I'm running a reverse proxy with nginx and using certbot for ssl. It's been
> working great but recently with an php server installation it's been giving
> me problems.
> I get access to the index but any other page I get a 404 error from nginx.

> location /site/ {
> if (!-e $request_filename){
> rewrite ^/site/(.*)$ /site/index.php break;
> }

You might be happier there with "last" instead of "break".

http://nginx.org/r/rewrite

But you might be happier still, replacing the three lines with something
like

try_files $uri $uri/ /site/index.php;

which is the usual nginx way to "fall back" to php processing.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx php reverse proxy problem

adrian.hilt February 12, 2020 07:43AM

Re: Nginx php reverse proxy problem

Francis Daly February 18, 2020 06:38PM

Re: Nginx php reverse proxy problem

adrian.hilt February 20, 2020 08:10AM

Re: Nginx php reverse proxy problem

Francis Daly February 20, 2020 09:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 305
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready