New answers tagged

0

I guess something was wrong with set_unescape_uri and the regex variable or something else. Using the single argument form of set_unescape_uri works. location ~* ^api/([^/]+)(/.+)$ { set $my_host $1; if ( $request_uri ~* ^api/([^/]+)(/.+)$ ) { set $my_path $2; set_unescape_uri $my_path; } proxy_pass ...


0

After a lot of trial and error, the sulution turned out to be: location / { try_files $uri $uri/ @extensionless-php; rewrite /(.+$) /products/$1 break; } location = /products/ { index index.php; } I hope this will help someone in the future.


0

Put the logos in different folders named like your domain, like ".../domain1.com/images", ".../domain2.com/images/". Inside these you put the respective logos all named logo.png Add another location to your server blocks: location /images/ { root /var/www/vhosts/domain1.com/httpdocs/$server_name/; } This should serve different logo.png files ...


1

Adding the below apache rewrite rules should do the trick for you. RewriteEngine On RewriteBase / # first redirect RewriteCond %{HTTP_HOST} !domain.com$ [NC] RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301] # second redirect RewriteCond %{HTTP_HOST} !example1.com$ [NC] RewriteRule ^(.*)$ https://example2.com/$1 [L,R=301] The above rules will do a ...


0

No. Nginx is a web server and a reverse proxy, you need to deal with this at the application level. Edit - if you modify your requirements somewhat you may be able to get something working. Maps might be worth looking into, shared document roots. But as your requirements stand right now I can't see an easy way to do it. That's not to say it's impossible, ...


0

We need to exclude the particular directory in htaccess file using conditional rewrite. In my case, it is RewriteCond %{REQUEST_URI} ^/archives/


3

AFAIK (but please don't take this for granted), these anchors are processed by the client, and not sent to the webserver. If this is true, you can't alter these via nginx. If you absolutely have to (but again: what's the point of this?), you need to do this at the client side, via JavaScript for example.


-2

Take a look at nginx rewrite rules. http://nginx.org/en/docs/http/converting_rewrite_rules.html http://nginx.org/en/docs/faq/variables_in_config.html http://nginx.org/en/docs/http/converting_rewrite_rules.html The rewrite directive might solve your problem. For a more specific answer more information is necessary.


0

Then add the following code to this newly created .htaccess file Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?$1 [L,QSA] RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC] RewriteRule ^ %1 [R=301,L]


1

Put it outside the location block and inside the server block. rewrite ^/membership-list.html /membership/; Then create the location with whatever you need: location /membership/ { } https://www.nginx.com/blog/creating-nginx-rewrite-rules/ http://www.imrantariq.com/blog/regular-expression-caret-or-circumflex-in-character-class/


0

It doesn't look like you took any steps to fix hosts and ports in Location headers. You probably got a bad redirect resulting in a 404. Either use proxy_redirect or set the websphere "private headers" like this document describes: https://developer.ibm.com/wasdev/docs/nginx-websphere-application-server/ > proxy_set_header "$WSSC" $scheme; ...


0

Mod Layout is now obsolete and if you don't want the overhead of calling an external script, the best solution which worked for me was mod sed. You can use mod sed to match first line of doc (1s) and add header script code there and match last line ($s) and put footer there. Options Indexes FollowSymLinks Includes ExecCGI Order Deny,Allow Deny from none ...



Top 50 recent answers are included