0
votes
1answer
29 views

Nginx Passenger Node Application URI Rewrite

I have a node application that accepts all routes starting at /. The Nginx / Passenger configuration for it is: server { listen 8889; server_name localhost; location / { root ...
0
votes
2answers
43 views

Nginx Wordpress rewrite for multiple sub-folders

I am currently setting up our new server for our company, and we are developing alot of different apps, and right now we want to have all our wordpress apps under wp.domain.com/app1, ...
0
votes
1answer
32 views

Nginx rewrite for a large group of URL's to a 444

I am looking for a rewrite that will pick up any number of defined URL's and do a return 444 on any of them. Rather than writing out each one individually, I was hoping for something where I could do ...
1
vote
1answer
75 views

Manage nginx rewrites in project folder

I am trying to figure out on how to migrate from Apache to nginx, keeping rewrite rules flexible to change for developers. This is our current setup: We have a .htaccess file in the root folder of ...
0
votes
1answer
58 views

Nginx - proxy_pass - specific location not working

I am trying to masking a remote URL with Nginx using proxy_pass I'd like to load staging.saas.localhost/_ when the browser url is saas.localhost/uk_staging. For some reason the location in ...
0
votes
2answers
39 views

Nginx rewrite rules with php args

I have 2 websites, http://localhost/bb -- phpbb http://localhost/dp -- Drupal I wish to redirect $server_name/bb/ucp.php?mode=logout&sid=xxxxx to $server_name/dp/user/logout, the sid should be ...
0
votes
1answer
32 views

Nginx Not Passing Rewrites To PHP-FPM

I have the following rewrite rules for nginx. The rules seem to not function correctly, for example the rule for games is supposed to rewrite http://thegamesdb.net/game/2/ to ...
0
votes
2answers
46 views

Nginx : rewrite request for 'p.test-prd.com.local' to 'www.test.com'

For various reasons, we follow an internal DNS scheme where the internal test site for 'www.test.com' would be 'p.test-tst.com.local'. I won't go into the details why we ended up with the scheme we're ...
0
votes
2answers
29 views

blogger to pelican nginx rewrite rule

I just converted my blog from blogger to pelican. On blogger, posts used to be something like: http://blog.example.com/2014/09/title-slug.html, now my blog on pelican is ...
0
votes
2answers
90 views

nginx use rewrite as dynamic 404 image

I want to get a dynamic 404 response depending on the requested url: foo.jpg doesn't exist http://example.com/img/style/thumbnail/foo.jpg should show ...
1
vote
2answers
112 views

nginx + varnish, optimize caching urls for ssl and not

I have a working varnish cache for my websites, with the undesired side effect that requests for a domain with http are cached with a certain url, and requests for https with another url. That way I ...
1
vote
1answer
71 views

Rewriting (not redirecting) a URL in Nginx

I have a situation that I think is a bit different from most. It's certainly different from any that I've encountered before: I'm building a site for a client who wants/needs to retain full control ...
0
votes
1answer
42 views

Nignx Redirect rule to a different url based on a query

We have a wordpress installation and need to redirect lost password link to another different url for this we trying to setup a redirect rule but this is not working. Can anyone please help us. ...
0
votes
1answer
28 views

why isn't this nginx rewrite working?

I'm trying to redirect wp-content/uploads/(.*)$ to images/$1 but this location doesn't appear to be redirecting - why? Would it be more efficient to use try_files? location ^/wp-content/uploads/.*$ ...
1
vote
1answer
121 views

Nginx rewite rules 403 error

I am having trouble with converting .htaccess files to nginx. I have 3 .htaccess files. The first .htaccess file is located in the document root and is as follows: Options +FollowSymLinks ...
0
votes
1answer
80 views

Serving multiple directory in one path/location with nginx

I have been trying serve multiple directories in one location so that all files can be access on /sys/assets/--FILE-- regardless of where is the file physically locate in the following folder ...
0
votes
1answer
30 views

Nginx to split web traffic to a blog hosted on my domain

At the moment, I am using an Nginx frontend to cache static content for my DotNetNuke based website hosted at the hypotetical address www.mydomain.com, along with some other tasks. In this era of ...
0
votes
0answers
37 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 ...
0
votes
1answer
26 views

nginx valid_referer for all files inside a directory

I have this config location /mirror/files { valid_referers none server_names example.com *.example.com; if ($invalid_referer) { rewrite ^/(.*)$ http://example.com/; } ...
0
votes
1answer
39 views

nginx Subdirectory Rewrites for MVC

I am tasked with administering a web application that has a base directory with a bunch of legacy code in it, and a subdirectory of my own making with an MVC based API which we are using to slowly ...
0
votes
1answer
143 views

Nginx redirect for specific file extension

I'm having trouble setting up the redirects for a Magento extension. The URL requested is: ...
0
votes
1answer
110 views

How to make Nginx include index.php in file paths for sub-directories as well (Magento Multistore)

Running multistore setup with Magento on an Nginx server. I'm watching the access logs and can plainly see what is happening. Like many PHP web apps, it uses index.php in its URLs and I have it set to ...
0
votes
2answers
42 views

nginx rewrite if requst_uri contains some numbers

I'm having a little problem with some rewrite rules for a website. My permalinks are now something like domain.com/ID/permalink-ID.html The old structure of permalinks was ...
1
vote
1answer
53 views

nginx rewrite tld to match language of site

I have an issue with my nginx config for my joomla site. I want to rewrite/redirect based on the tld used. Example: domain.fr -> domain.com/fr domain.se -> domain.com/se How can I achieve this?
0
votes
1answer
89 views

Convert apache rewrite rules to nginx

I want to migrate an Apache setup to Nginx, but I can't get the rewrite rules working in Nginx. I had a look on the official nginx documentation, but still some trouble converting it. ...
2
votes
2answers
156 views

nginx rewrite regex for API versioning

What I want is for the first to be turned into the second.. /widget => /widget/index.php /widget/ => /widget/index.php /widget?act=list => ...
-2
votes
1answer
103 views

Nginx rewrite rule not working

Can someone help me convert this rule? I have over 50 rules, but I can not make this rule work: #APACHE RewriteRule ^([^/]*)/([^/]*)\.html$ /?cmm=$1&page=$2 [L]
0
votes
0answers
185 views

Nginx PHP index.php rewrite not allowing proxy pass to '/writing'

What I'd like: I want to have the laravel site show unless it's for /writing. In that case I want it to proxy pass anything in that subdirectory to a nodejs site. What happens: The laravel site ...
0
votes
1answer
190 views

Howto rewrite URLs with two nginx as reverse proxies to gunicorn/Django

I have a Django application, deployed with gunicorn on port 8000, on a VM with a backend nginx, port 80, on the same VM. The nginx config is: location / { proxy_http_version 1.1; ...
0
votes
2answers
128 views

nginx rewrite location not found

in Nginx config file, did set rewrite location like below but do not work and every time return 404 not found, what is the problem here? server { listen 80; server_name mydomain.com ...
0
votes
3answers
49 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 ...
0
votes
1answer
75 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/; ...
0
votes
1answer
76 views

Using nginx to access internet through intranet

I don't know if I am going about this in the right way, but here's what I need to do. I have a website that's available on the internet. But I have some users who only have access to the intranet. I ...
0
votes
1answer
96 views

Nginx rewrite, from htaccess-files

I've got a PHP-project set up in this directory tree: project v1 app (project files) public index.php (controller of app) documentation php files examples php files With "project" being ...
0
votes
2answers
219 views

Nginx rewrite URLs but not static files

I need to rewrite URLs like http://www.domain.com/blog/wp-content/uploads/this-is-a-static-file.jpg to http://www.domain.com/wp-content/uploads/this-is-a-static-file.jpg I am using this rule: ...
0
votes
1answer
225 views

Nginx Rewrite Rule For File Within Folder Not Working

Good evening everyone or possible early morning if you are in my neck of the woods. My problem seems trivial but after several hours of testing, researching and fiddling I can't seem to get this ...
1
vote
2answers
2k views

nginx url rewriting. i just don't get it

Ok, an example url is http://www.mysite.com/?p=account&view=settings the p uri is a constant. all urls have it. the view is one of many optional uri. i've tried to understand url rewriting ...
0
votes
1answer
185 views

How to tell Nginx to not rewrite URL's in selected location

I am writing some PHP CMS code with a clean url implementation in Nginx. To improve security of my code I want to rewrite all of the requests in my root directory / using the following type: rewrite ...
0
votes
1answer
502 views

Nginx URL virtual host rewrite issues with Magento e-commerce. Help please

I've been running into some serious problems with my URL rewrites and I can't seem to fix it on my own strength and knowledge and troubleshooting on the web! Basically what happens is that when I ...
1
vote
2answers
145 views

nginx point subdomain to subfolder

I want http://blog.domain.com/ to point to http://www.domain.com/blog Just a notice, not to redirect to that location, but just point to it. Also /blog is not a folder. It could be blog.php for ...
1
vote
1answer
365 views

nginx - specify different index file name for subdirectory

I want the directory index file in the root of my site to be index.html but within a subdirectory /foo I want it to be bar.html i.e. /index.html /foo/bar.html Also I want requests to /foo or ...
0
votes
1answer
166 views

Lighttpd rewrite rule for Flight PHP microframework

I'm using the Flight PHP microframework, and it includes its' own router, and needs the server to rewrite requests to the index.php file. It features rewrite-rules for both Apache and Nginx but ...
1
vote
2answers
2k views

Nginx: rewriting https:// to http://

I'm trying to get Nginx to rewrite incoming requests to a site my server prefixed with https:// to http:// (this is because a CMS used on this site forces URIs instead of relative paths -- essentially ...
0
votes
1answer
90 views

Static Wordpress Multi-Site Rules From Apache to Nginx

I have been reading and trying things for 3 days, but I can't seem to get the right combination of rules to do what the Apache2 server did. The Apache2 rules are: RewriteRule ...
1
vote
1answer
506 views

Rewrite on root of domain only in nginx

I've got YOURLS server running to host short urls for my company, so that we can provide short URL's to our customers. I'm using nginx, and for root of the domain, if they aren't using a proper short ...
0
votes
1answer
106 views

Can Nginx redirect or rewrite URLs starting with “?” without using an “if” directive?

I have an RSS feed example.com/?format=feed&type=rss from an old Joomla install. The site is now built with Jekyll, and uses a new URL example.com/rss.xml for the RSS feed. Rewrite rules ...
1
vote
1answer
153 views

How to transparently redirect a user without rewriting URL when page does not exist?

I have a node web app with nginx acting as a proxy. Here's the server block for that site : server { listen 80; server_name subdomain.example.org; location / { ...
-1
votes
2answers
207 views

URL Shortener & Site Redirection on same domain

i have one domain(http://sdm.fm), And I would like it to work as a redirect to http://somdomato.com. But at the same time I would like it to work as a URL shortener. Using phURL. Like: ...
0
votes
1answer
52 views

Nginx and Wordpress: Add php after postname

I'm doing a migration from Apache to Nginx of some Wordpress sites. Now I'm dealing with the URL rewriting, because one of the blogs has the following URL structure: %postname%.php And I'm using ...
0
votes
1answer
122 views

Nginx Extract Top Directory Name From Request URI

I am in the need of being able to use top directory from the $request_uri, for example: /dir/sub/slug -> /dir I read the answer of this question: How to extract Only the file name from the request ...