Forum: NGINX _GET parameters with question and ampersand

2974d09ac2541e892966b762aad84943?d=identicon&s=25 arnas (Guest)
on 2014-04-14 11:04
(Received via mailing list)
Hi,

I am wondering how do I solve parameters being passed correctly after
switching from apache.

http://app.mailerlite2.com/test/test_get/?labas=testarg NOT passing
http://app.mailerlite2.com/test/test_get/&labas=testarg PASS

# 1 server, proxy passes to internal server #2

server {
  listen X.X.X.X:80;
  server_name  _;

    location / {
  proxy_pass http://192.168.53.30;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP        $remote_addr;
  proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# 2 server
server {
  listen       192.168.53.30:80;
  server_name ~^(?P<subdomain>.+)\.mailerlite2.com;
        root    /var/www/html/mailerlite2/public_html;
        index   index.php;
        try_files $uri $uri/ $uri/index.php /index.php;

        access_log /var/log/nginx/access.log;
  client_max_body_size  300M;

        location ~* /data/emails/ {
                root /var/www/html;
      expires 7d; access_log off;
      add_header Cache-Control "public";
      location ~* \.php$ {return 403;}
        }
    location ~* "^/data/custom_html" {
      root /var/www/html;
      location ~* \.php$ {return 403;}
    }

        location ~ \.php$ {
                try_files $uri =404;
                include fastcgi.conf;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME
document_root$fastcgi_script_name;
                include fastcgi_params;
        }
        location ~ /\. {
                deny all;
        }
        location / {

        # Directives to send expires headers and turn off 404 error
logging.
        location ~*
^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$
{
                root    /var/www/html/mailerlite2/public_html;
                expires max; access_log off; log_not_found off;
    add_header Cache-Control "public";
        }
        location ~* ^.+\.(css|js)$ {
                root    /var/www/html/mailerlite2/public_html;
                expires 72h; access_log off;
    add_header Cache-Control "public";
        }
}

http://p.ngx.cc/170041499f94175e

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249267,249267#msg-249267
2974d09ac2541e892966b762aad84943?d=identicon&s=25 arnas (Guest)
on 2014-04-22 14:48
(Received via mailing list)
2974d09ac2541e892966b762aad84943?d=identicon&s=25 arnas (Guest)
on 2014-04-22 16:02
(Received via mailing list)
I was able to solve it with correct arguments passing

        location / {
                try_files $uri $uri$is_args$args
/index.php?subdomain=$subdomain&content=$uri&$args;
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249267,249454#msg-249454
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.