0
votes
1answer
35 views

nginx wildcard redirect suspicious symbols warnig

I would like to create a 301 redirect on nginx to do this: *.example.gr/en/* => http://www.example.gr/el/ I have tried to do: server{ listen 80; server_name ~^.example.gr/en/*; return ...
-1
votes
2answers
51 views

Nginx: Redirect IP address to domain name

With the following Nginx config: server { listen 80; listen [::]:80 default_server ipv6only=on; server_name isitmaintained.com; ... } server { listen 178.62.136.230:80; ...
0
votes
0answers
35 views

How to make subdomain point to a different path without a redirect?

How can I make http://param1.domain.com act as if it's loading http://domain.com/param1 in Nginx? I do not want to redirect to http://domain.com/param1. So far I have created a new server block ...
-1
votes
1answer
38 views

Strange php redirections with nginx (Works fine in apache)

Finally I decide to ask here after hours trying, searching and researching. Months ago I migrated my site to a newer version and everything works fine with my old hosting in apache. Recently I ...
0
votes
0answers
33 views

Nginx redirect https://www.dom.com to https://dom.com on multi-domain setup

I am struggling to get my Nginx to redirect my ssl requests. It is a bit complicated setup I believe. I have multiple servers on multiple domains and subdomains, say sub1.dom.com, sub2.dom.com, and ...
0
votes
0answers
104 views

307 redirects with nginx, or proxy_pass?

The specifics of my platform: I am redirecting users from non-www to www I'm forcing SSL on all users by redirecting requests to port 80 to https I'm running nginx, Unicorn and Rails 4.1 Here's my ...
0
votes
1answer
173 views

Redirect all http requests behind Amazon ELB to https without using if

Currently I have an ELB serving both http://www.example.org and https://www.example.org. I would like to set it up so any request pointing to http://www.example.org is redirect to ...
1
vote
1answer
46 views

NGINX - Remove index.php from the end of the URL

I can access my webpages with "www.dom.com/mypage" which will redirect to "www.dom.com/mypage/". "www.dom.com/mypage/index.php" is the main file but I want to remove this from the url so if you type ...
0
votes
0answers
135 views

nginx: Redirect all requests to a proxy, but not these three specific URLs

nginx can be tricky sometimes: I want to redirect all incoming requests for www.sub.domain.com/* to www.other.domain.com/* use a proxy so users still see the original www.sub.domain.com when ...
0
votes
0answers
30 views

nginx Infinite Redirect Loop / PHP Download

I want to redirect requests all requests with /login to a particular page but that page also has /login in it, so the redirect can't apply to the target page. Right now I have something like this: ...
0
votes
3answers
54 views

Nginx server redirect being ignored

I'm must be stuffing this up somewhere but can't see where. Nginx appears to be ignoring the following redirect. This currently resides in its own conf file, but I have placed it in the other files. ...
0
votes
1answer
168 views

tomcat7 + nginx ssl causes redirect loop

We have the following set-up: several subdomains lead to the same server, which is running nginx as a proxy to each of them. All subdomains are currently used for testing features in development, so ...
0
votes
3answers
48 views

How to remove hypen (-) using nginx rewrite rule?

I am using this rewrite rule to redirect example.com/a-b-c?id=learn-more ----> http://example.com/abc?id=learnmore rewrite ^/a-b-c?id=learn-More http://example.com/abc?id=learnMore permanent But ...
1
vote
1answer
35 views

Nginx HTML content while redirect

When the redirection is configured in nginx, the response contains: <html>[CRLF] <head><title>301 Moved Permanently</title></head>[CRLF] <body ...
0
votes
1answer
51 views

Nginx SSL redirect without if

In this question: rewrite http to https with ngnix behind load balancer the question is how to force SSL for nginx servers behind a loadbalancer. The problem with this setup is that the loadbalancer ...
0
votes
1answer
68 views

redirect string to different url in nginx

I want to redirect a string to different URL in nginx. This what my vhost looks like and is working fine. server { listen 80; server_name secure.example.com; root /opt/tomcat/webapps/test/; ...
1
vote
1answer
72 views

Nginx not redirecting but is working

This is my first setup with nginx and I'm using it to proxy to nodejs. HTTP is on port 3000, and HTTPS is on port 3001. If I go to http://test.domain.com it loads the regular unsecure pages. If I go ...
0
votes
1answer
52 views

How to make Nginx redirect without adding a tail string to redirected server

I have an Nginx that redirects to several different web servers based on URL path after host. My Nginx host is nginx.main.com current redirect rules are # Redirects for Math location ~ ...
0
votes
0answers
77 views

How to make lighttpd respect X-Forwarded-Proto when constructing redirects for directories?

We have an nginx proxy at tools.wmflabs.org that receives requests by http and https and passes them by http on to lighttpds on a grid (one lighttpd per top-level path). Requests that reach the proxy ...
0
votes
0answers
124 views

Nginx redirects from https to http, without directive

I have a big problem with Nginx. I am serving LimeSurvey API, and my config worked well, except for Firefox. So I upgraded to 1.6 (I have CentOS 6). Now, it redirects from https to http, with a 302. ...
0
votes
0answers
41 views

No longer can get nginx.conf to respect my redirect rules

I want to redirect all sites and subdomains to one https domain name. I'll use https://my-site.com as an example. Previously I had all the redirection working with the following code: server { ...
0
votes
1answer
113 views

Redirect all subdirectories to root with nginx

I'm running a web application at my site's root. I would like it so that all subdirectories (even ones that exist) are directed to the root e.g. example.com/anything would redirect to example.com. ...
1
vote
1answer
619 views

nginx infinite 302 Found redirect loop

I am using nginx to map multiple domains to google app engine. in this specific case i map multiple domains to the same tenant. there is a configuration in my code that knows which domain is the main ...
1
vote
1answer
168 views

Rewrite nginx rule for for a directory to another domain/sub domain

i have setup the following nginx rewrite rule . But doesn't seems to be working, * location /images { rewrite ^(.*)$1 http://sub.domain.com/$1 permanent; } * for images i'm trying to ...
2
votes
2answers
4k views

Nginx Redirect via Proxy, Rewrite and Preserve URL

In Nginx we have been trying to redirect a URL as follows: http://example.com/some/path -> http://192.168.1.24 where the user still sees the original URL in their browser. Once the user is ...
1
vote
2answers
65 views

Redirect all URLs to a single URL

I have a machine foo00 whos CNAME is foo. With nginx I can access my site from the following URLs: foo/ foo00/ foo.domain.local/ foo00.domain.local/ How can I configure nginx so that all are ...
0
votes
0answers
640 views

Nginx redirect requests to mobile app by user agent

I have 2 applications running under the same server. The server is using Nginx to serve the Unicorn upstream of both apps, one is intended for mobile user and the other one is intended for all other ...
1
vote
1answer
730 views

Nginx redirect all old domain subdomains to new one

I had a very long domain, so I decided to change it to a shorter and more friendly one. But since I have a lot of subdomains (in fact, I have a subdomain wildcard), I wanted to keep the subdomain ...
0
votes
2answers
597 views

Enabling multiple domains in a server block of nginx

I am using nginx for request forwarding on my server.I have two server blocks,one for the main website and the other server block to serve my S3 static content. server { listen 80; ...
0
votes
1answer
965 views

Nginx. Using redirects with regular expressions

I'm a newbie to nginx. I have the nginx before Apache and I'm having problems. I seem to need 2 rules in the config: Rule 1) if we have url "/my_path" we don't touch it but user goes to ...
3
votes
2answers
263 views

Redirect to 404 if filename passed as parameter does not exitsts

I have special parameter data=/path/to/filename.htm in uri. Its old and rusty site builded on SSI, and I can't modify it. Problem is when filename passed as arg_data not exists, page is broken. I ...
1
vote
1answer
154 views

nginx 301'ing limit_req rate limited requests instead of error page

I have a bulk search form on apache servers behind nginx. I'd like to protect that location so that the second request in a 10 minute period gets 301'd to a "Would you like to use our API" page ...
1
vote
1answer
1k views

Use nginx reverse proxy for redirection

I have a.b domain (for example) and want to serve some github pages (username.github.io/project) in a.b/c. It means that I also want to keep my browser url to a.b/c and showing contents of ...
0
votes
1answer
158 views

How to preserve request headers while redirecting using nginx X-Accel-Redirect

My scenario: A sends request to B with some custom headers. Nginx proxy the request to B, where B does some logic and sets X-Accel-Redirect response header pointing to C. Then Nginx redirects request ...
0
votes
0answers
43 views

nginx rewrite subdomain to other subdomain

I have a atlassian server with the following config: server { listen 443; server_name servicedesk.example.nl; ssl on; ssl_certificate certs/jira.cer; ssl_certificate_key ...
0
votes
0answers
140 views

How do I get Nginx to conditionally redirect my gitlab home page?

I had asked this question on Stackoverflow - How do I change the default home page of my gitlab installation? (unable to post SO link) and was told to put a support request with gitlab and I did so - ...
0
votes
1answer
40 views

Nginx Specific Redirect Rules

I'm trying to read all the suggestions and tips that are present in this forum but I cant find a way to make this rule work. I want that if a specific url is requested that nginx redirect permanently ...
0
votes
0answers
468 views

Varnish redirect loop

I've tried with a lot of varnish configurations and always experience the same redirect loop, after varnish is running for a couple of hours some pages are displaying the message: The page isn't ...
3
votes
2answers
57 views

nginx redirect /2013/04/test.html to /test - not working

I've been going mental over this. How can I redirect a certain url like /2013/04/test.html to /test in nginx? I have tried this: but doesn't work: server { location /2013/05/test.html { ...
1
vote
2answers
1k views

nginx unwanted location redirect with trailing slash

I have a location location /pass/ { proxy_pass http://localhost:12345/; } So it is supposed to proxify urls http://example.com/pass/whatever to http://localhost:12345/whatever The thing I ...
0
votes
1answer
663 views

Ngnix Rewrite - If URL contains

I'm having a small issue - my error log is filling up with requests to a directory folder on my site (but with added data that shouldn't be there). http://example.com/the-directory/undefined ...
0
votes
1answer
106 views

Nginx Vhosts with SSL

I have 3 domains running on an nginx server with ssl domain.pw domain.info domain.mobi i have sni enabled, and am using a vhost for each site. the host records for the site are all like this A ...
1
vote
1answer
2k views

Nginx redirect all request that does not match a file to a php file

I'm trying to get all request to: http://mydomain.com/downloads/* redirect to http://mydomain.com/downloads/index.php except if the requested file exist in /downloads/ ex: ...
0
votes
1answer
130 views

nginx and try_files confusion

I am confused with how try_files works on nginx, this needs to be done on a live production server so can't test before being 100% sure. I am using header("X-Accel-Redirect: /out/" . $fname); to ...
0
votes
0answers
109 views

Nginx redirect to another domain if static file not found or cache/gzip

I had this code in my config file, and it worked: try_files $uri @redirect-to-main; location @redirect-to-main { rewrite ^ https://main.com$uri redirect; } Now I need to add cache/gzip ...
0
votes
1answer
191 views

Nginx - Rewrite Domain to Domain with full URL

I need to setup nginx to rewrite "www.test.com" to "www.new-test.com/test/test?foo=bar&bar=foo". I've tried the following code: server { listen 80; server_name test.com www.test.com; ...
2
votes
1answer
70 views

nginx - which way is better to redirect and why

I want to redirect from www.mydomain.com to domain.com in nginx. I search the internet and found two ways: First way server { listen 80; server_name www.domain.com; ...
0
votes
1answer
1k views

Nginx: Rewrite/Redirect URLs in a subdirectory to root

I want to rewrite or redirect any URLs inside a subdirectory to root, like so: www.site.com/subdirectory/item => www.site.com/item I tried this, but doesn't seem to work properly: location ...
1
vote
2answers
148 views

nginx redirect with dns name

I have nginx redirect like: server { listen 127.0.0.1:80; ...
0
votes
4answers
1k views

Nginx - Wordpress Redirect Loop

I'm using nginx as a frontend for apache2. Apache2 will handle all dynamic content. This is my main file with nginx being a frontend for apache and having all dynamic pages forwarded to apache2: ...