Nginx If /something.php is called act as is opened

April 2, 2015 458 views
Nginx LEMP Apache

I want to open IP/something.php and to see everything as if i opened

And without redirections, preserving URL1 and pass all GET params to URL2

URL1: ""
URL2: ""

I tried something like this, but nginx proxy mod is quite huge to understand

location /something.php {
proxy_set_header Host $host;

But this redirects URL and seems like doesn't pass GET params

p.s. in apache it was all possible just with mod_proxy and two lines

    ProxyPass /filename.php
    ProxyPassReverse /filename.php
1 comment
  • Use the following line

    location /my/ {
        rewrite ^ /my.php?$1 last;

    matching it with your details.

    edited by asb
Be the first one to answer this question.