-1
votes
1answer
20 views

Exclude location from nginx if directive

Currently I use this for redirecting everybody to the SSL page: if ($scheme != "https") { rewrite ^ https://$server_name$request_uri? permanent; } does someone know how to exclude a specific ...
-2
votes
1answer
36 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
114 views

nginx rewrite for php restful api apache htaccess

I have an apache htaccess file used with Restful API tutorial <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ...
0
votes
1answer
57 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
0answers
299 views

Reverse proxy 502 bad gateway

I have setup a subdomain to proxy my plesk panel, but when saving pages I am getting 502 Bad Gateway error instead of a completion message. I am running CentOS 6. Here is my vhost.conf configuration ...
0
votes
1answer
107 views

convert lighttpd to nginx rewrite rules

I'm trying hard to make my code work on nginx. This configuration works with lighttpd but I want migrate it to nginx. Rewrite rules on lighttd : url.rewrite-once = ( "^/(ui)/(.*)$" => ...
0
votes
1answer
499 views

nginx url rewrite rule

I'm doing a migration from a WordPress blog to a Jekyll Blog using NGINX as my HTTP server and I don't want to break the Internet by leaving some URL's not working as expected. I got to a point where ...
0
votes
0answers
126 views

How to exclude a URL from mod-rewrite with nginx?

I'm moving my Joomla! 2.5 from Apache Ubuntu to Debian nginx and I need to exclude some URLs from the mod-rewrite. Now I'm rewrite all within this directive on the IspConfig panel: # mod_rewrite url ...
0
votes
0answers
268 views

access restriction using http_referer in nginx

access restriction in nginx URL: http://test.example.com/pentaho/reporting/reportviewer/report.html?solution=steel-wheels........... I will call the above URL from ...
-1
votes
1answer
82 views

Nginx redirect sub.domain.com/users/page/somename to somename.sub.domain.com

I've been trying to redirect http://sub.domain.com/users/page/somename to http://somename.sub.domain.com etc. Any pointers?
0
votes
2answers
566 views

How to change NGINX server name

In the Apache web server we can change the server signature (Apache Name) using mod_rewrite. For example - ...
0
votes
1answer
60 views

Converting .htaccess to nginx

RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) p.php?id=$1 [L,QSA] How would I change that to work with nginx? Also, where do I place ...
1
vote
1answer
156 views

nginx, apache http authentication

I have an nginx reverse proxy server which feeds into a varnish cache with an apache backend. The php is running as a fastcgi process started from apache. I was attempting to get some php software ...
-1
votes
1answer
77 views

Converting rules from apache to nginx

I have problem with these rules: ErrorDocument 500 http://example.com/500.html RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] RewriteCond ...
1
vote
1answer
71 views

How can I express this nginx config as apache2 rewrite rules?

if (!-e $request_filename){ rewrite /iOS/(.*jpg)$ /$1 last; rewrite /iOS/(.*jpeg)$ /$1 last; rewrite /iOS/(.*png)$ /$1 last; rewrite /iOS/(.*css)$ /$1 last; ...
0
votes
1answer
235 views

nginx: rewrite a non-existent php-file to another php-file with all arguments

i really need help here. Sitting for some time now and dont figured it out. I want to realize a very simple task - rewrite a non-existent php file to another existant php file with all arguments ...
0
votes
1answer
133 views

Migrating Apache rewrites to Nginx

I am trying to serve static HTML with server side PHP processing with Nginx. I have no experience with Apache. I would like to migrate the following re-writes from Apache's .htaccess to Nginx. What ...
0
votes
2answers
287 views

Issues with Apache redirect to www-prefixed URL

I have a website with domain mysite.com. I would like to have it so that if a user types in "mysite.com" it will redirect to "www.mysite.com". Additionally, "mysite.com/subdir" will also redirect to ...
1
vote
1answer
407 views

Convert from apache rewrite to nginx

I want to convert from apache rewrite modules to nginx RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond ...
1
vote
1answer
2k views

Apache proxy pass in nginx

I have the following configuration in Apache: RewriteEngine On #APP ProxyPass /abc/ http://remote.com/abc/ ProxyPassReverse /abc/ http://remote.com/abc/ #APP2 ProxyPass /efg/ ...
1
vote
0answers
118 views

convert apache rewrite to nginx

I am confused to convert this rules to nginx. RewriteEngine On RewriteCond %{REQUEST_URI} ^(.+)\~s$ RewriteRule ^(.*) stats.php?u=$1 [L] RewriteCond %{REQUEST_URI} ^(.+)\~d$ RewriteRule ^(.*) ...
0
votes
1answer
177 views

nginx rewrite rules for cached images

we are currently migratiing all services from apache2 to nginx but are currently stuck with a specific rewrite rule. The rule in apache is checking if a cached image/thumbnail exists and if so, ...
1
vote
1answer
128 views

Converting from Nginx to apache rewrite rules

I am trying to set up a site which uses code cloned from http://usesthis.com/ My site is at http://hackingtheuniversity.net/ You'll see that each interview post on the site, uses the following URL ...
1
vote
1answer
590 views

Convert nginx to Apache rewrites

I'm trying to set up CodeIgniter from an existing site that's on nginx. My local machine is Apache and this is the redirect scheme on nginx. How do I write this using RewriteRules? if ($host ~* ...
7
votes
2answers
4k views

best way to debug nginx config file?

I have a bunch of rewrite rules that I have to port from apache to nginx. It's a rather painful process because I'm not able to see if my rewrite rules and "if" conditions are working as I want them ...
0
votes
2answers
127 views

nginx rewrite to alphabetized subdirectory

I'm trying to convert the following Apache mod_rewrite rule into an appropriate nginx format: RewriteCond %{REQUEST_FILENAME} (.*)/([^\/])([^\/]+)/?$ RewriteCond %1/%2/%2%3 -d RewriteRule ^/?.* ...
0
votes
0answers
257 views

apache mod-rewrite to nginx rewrite

I just changed to NGINX from Apache and I am using Zencart with Ultimate SEO for friendly urls I have tried to convert my .htaccess rules for NGINX but I get "No Input file specified" or a 404 error. ...
1
vote
1answer
204 views

nginx if directive has stopped working after upgrading from 0.7 to 1.0.2

I upgraded my nginx server from 0.7.x to 1.0.2 and I copied the old configuration file for the new nginx server. Everything worked fine, except for the if-directive. I had the following block of code ...
6
votes
4answers
8k views

Controlling Nginx proxy target using a cookie?

I'm trying to convert a reverse proxy using an interesting Apache mod_rewrite setup to use Nginx instead (due to external concerns we are moving from Apache to Nginx, and most everything works fine ...
0
votes
1answer
476 views

nginx redirect to a subdomain even without trailing slashes

I just installed and partially configured nginx on a dedicated server of mine. But I've got some trouble understanding the regexp. I would like to make nginx redirect www.mydomain.com/forum/ AND ...
1
vote
1answer
183 views

nginx image rewriting

is it possible to rewrite images? image store in /very/big/path/1.jpg , i want /img/1.jpg how can it be done?
2
votes
1answer
2k views

Nginx, PATH_INFO, and url-rewriting: i must be missing something

I'm switching from Apache to Nginx/fcgi and I'm having a small issue while attempting to setup the applications rewrite rules. The code handles routes via the use of PATH_INFO, e.g., ...
0
votes
1answer
192 views

Converting Apache RewiteRule to Nginx's

i just installed nginx up and running for serving static content on my site. it works great but the apache rewrite rule about images (ofcourse) stoped working. and i don't have an idea how to convert ...
0
votes
3answers
386 views

Apache rewrites to Nginx

I'm trying to install thebuggenie on my Nginx server. Unfortunately, it sits in a subdirectory (nothing I can do about it) and uses apache rewrites for ALL of it's URLs. I had some success when I had ...
0
votes
1answer
2k views

What is the nginx equivalent to this mod_rewrite rule?

My wordpress is telling me to update my htaccess file to: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
3
votes
2answers
509 views

Nginx rewrite with an external program

In Apache's mod_rewrite module there is a feature called RewriteMap. This allows an external program to be called to handle the redirects (allowing for more complicated redirecting). Is there an ...
2
votes
1answer
1k views

nginx pass REMOTE_USER to apache2

I am running an apache2 instance behind an nginx reverse-proxy, with nginx performing basic authentication and apache2 serving up Nagios cgi scripts. I am able to send the authenticated user from ...
1
vote
1answer
583 views

Apache htaccess -> Nginx rewrites

Help me please to write nginx rewrites instead of that Apache htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
1
vote
1answer
965 views

Apache, Nginx, ReverseProxy, URL Rewriting

Can i configure apache reverse proxy server so that it load some of files from local document root? Like may be static files? Can i used Nginx as a alternate for Apache (mod_proxy, mod_proxy_html, ...
0
votes
1answer
784 views

Conditionally changing MIME type in nginx

I'm using nginx as a frontend to Rails. All pages are cached as .html files on disk, and nginx serves these files if they exist. I want to send the correct MIME type for feeds (application/rss+xml), ...
1
vote
1answer
4k views

nginx rewrite rule

I have the following mod_rewrite rule RewriteCond %{HTTP_HOST} !^(host)\.doamin\.com [NC] RewriteCond %{HTTP_HOST} !^(www)\.domain\.com [NC] RewriteRule ^(.*) /magento/$1 [L] I need that to work in ...