Tag Info

New answers tagged

0

These are the rewrites I ended up with and they work: # Rewrite to old design RewriteCond $1 !^php5.fastcgi [NC] RewriteCond %{HTTP_COOKIE} ^((?!new_layout).)*$ RewriteRule ^/(.*)$ /home/user/dev/user.dev/htdocs/$1 [L] # Rewrite to new design RewriteCond $1 !^php5.fastcgi [NC] RewriteCond %{HTTP_COOKIE} !^new_layout$ RewriteRule ^/(.*)$ ...


0

This may not be what you're wanting, but you could set up another Apache proxy such as in a virtual machine and modify the /etc/hosts file there. Then traffic would travel through two proxies - the one you have now followed by the one you set up on the virtual machine. Not ideal I know, but a possible solution if nobody comes up with something better. ...


-1

You should define multiple server blocks. See this page for the server_name precedence. server { listen 80; server_name subdomain.example.com; # ... what you want to serve at http://subdomain.example.com/ ... } server { listen 80; server_name example.com *.example.com; return 301 https://example.com$request_uri?$query_string; } ...


0

Here's what works for me: <VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com # [ snip some unrelated stuff ] # Redirect secondary hostnames to canonical hostname RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com$ RewriteRule (.*) http://www.domain.com$1 [R=301,L] </VirtualHost> The advantage of doing this instead of ...


0

This seems to have done the trick... http { limit_conn_zone $binary_remote_addr zone=default_con:20m; limit_req_zone $binary_remote_addr zone=php:1m rate=2r/s; location ~ \.php { ## LIMIT REQUESTS TO STOP SERVER GETTING NAILED ## limit_req zone=php burst=7 nodelay; limit_conn default_con 2; fastcgi_index index.php; ...


3

Your problem is that browsers don't even send the fragment identifier to the server, so even if Nginx was willing to rewrite based on that, it wouldn't be able to do so because it wasn't provided with that info. I'm really curious about how your previous solution worked with Apache - I just double checked and my Firefox doesn't send the fragment identifier ...


1

For domain: www.example.com, use: # SSL-FORCE RewriteCond %{SERVER_PORT} !443 RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] You can also try: RewriteCond %{SERVER_PORT} !443 RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] If port is not 443 and host name starts with www, perform rewrite. This ...


0

Right, fixed this (I think) Install application request routing Enable kernal-mode in windows auth. Lets hope....


0

Try location = /download.php { rewrite ^ /views/download.php$is_args$args last; }


0

After a lot of trial and error, this is the configuration that would work and perform as expected. The problem with my previous version was double: Nginx rewrites outside locations were messy and they would just refuse to work by creating nasty loops Nginx was checking the existence of a cookie which is set by a php application behind nginx. Thanks to ...


0

This works for me: <rule name="Redirect to HTTPS" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" /> </rule>



Top 50 recent answers are included