Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Nginx rewrite not working as expected

$
0
0
Below block working file http://192.168.112.132/sess454/wordpress
If index.php file just have echo "index";

If there actual wordpress files then it redirect to http://192.168.112.132/wordpress
But I want to keep session token in url http://192.168.112.132/sess454/wordpress


location ~ ^/sess([a-z0-9]+)/(wordpress)(.*)?\.php$ {
root /usr/local/nginx;
include fastcgi.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

if ($uri ~ "^/sess([a-z0-9]+)/(wordpress)") {
rewrite ^/sess([a-z0-9]+)/wordpress /wordpress/$2;
}


if ($uri ~ "^/sess([a-z0-9]+)/(phpmyadmin)") {
rewrite ^/sess([a-z0-9]+)/phpmyadmin /phpmyadmin/$2;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>