Welcome! Log In Create A New Profile

Advanced

nginx : PrettyUrl doent work (Yii2)

Maulik patel
October 15, 2017 10:18AM
Hi Team,

You are doing Great Job. Just i need a small solution from you guys.

I have installed nginx server and i set for backend 'enablePrettyUrl' =>
true,

Below are the my default.conf file

server {
listen 80;
server_name SERVER_IP;

# note that these lines are originally from the "location /" block
root /usr/share/nginx/html;
index index.php index.html index.htm;

location / {
try_files $uri $uri/ =404;
}

error_page 404 /errors/404.html;
error_page 500 502 503 504 /errors/50x.html;
location = /errors/50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}}

When i run http://SERVER_IP/backend/web/CONTROLLER_NAME
http://server_ip/backend/web/CONTROLLER_NAME Its redirect to me in 404
error page.

Can you please tell me how to enable pretty url in yii2 with nginx
configuration? Please note that there is static website so my root path
will be /usr/share/nginx/html



Thanks,

Maulik

------------
Your regards,
Maulik Patel
Phone : +91-942-935-9528
Skype : maulikpatelbtech
LinkedIn : https://in.linkedin.com/in/maulikpatelbtech
Stack : https://stackoverflow.com/users/833817
https://in.linkedin.com/in/maulikpatelbtech
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

nginx : PrettyUrl doent work (Yii2)

Maulik patel 1821 October 15, 2017 10:18AM

Re: nginx : PrettyUrl doent work (Yii2)

Valentin V. Bartenev 569 October 17, 2017 02:32PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 145
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