Using NGINX Web Server (v2021)

Tips submitted by PHPMaker users
Post Reply
lamorte1977
User
Posts: 92

Using NGINX Web Server (v2021)

Post by lamorte1977 »

Nginx was written specifically to address the performance limitations of Apache web servers.
Is lightweight and since 2019 is most used webserver.
Would be nice to have it supported.


CasperBR
User
Posts: 6

Post by CasperBR »

the nginx redirect does not work because the requests from the api /api/action are redirected to the application's root folder.
Any suggestions?


arbei
User
Posts: 9284

Post by arbei »

PHPMaker 2021 generated site works fine with NGINX web server, see Nginx configuration about how to configure your NGINX web server.

Don't forget that you need to set up URL rewrite for the API folder also, e.g.

        # project folder
        location / {
            try_files $uri /index.php$is_args$args;
        }

        # api folder
        location /api/ {
            try_files $uri /api/index.php$is_args$args;
        }

lamorte1977
User
Posts: 92

Post by lamorte1977 »

Ops, missed this reply.

The problem was at api location.

Thanks

 # api folder
        location /api/ {
            try_files $uri /api/index.php$is_args$args;
        }

ufone
User
Posts: 51

Post by ufone »

if my folder name is phpapp. how this will be wirte. i need chnage in index.php file?


arbei
User
Posts: 9284

Post by arbei »

Read above and URL Rewrite -> Nginx.


Post Reply