New answers tagged

1

The following worked: server { listen 80; listen [::]:80; server_name blablabla.com; proxy_cache one; listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate ....; ssl_certificate_key ....; location / { proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; proxy_pass https://f002.backblazeb2.com/file/some-directory/...


2

There are several solutions, and they all use an if rather than a rewrite as the latter cannot operate on argument strings. If this is the one and only URI that needs to be redirected, the simplest solutions is: if ($request_uri = /myservice/pages/service/service.html?URL=/eServiceCNX/eservice.dll ) { return 301 /myservice/pages/service/service.html?...


0

I solved the problem. Solution: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName ip-of-server DocumentRoot /var/www/html/ <Directory /var/www/html/emall2> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> Greetings!


0

All I had to do was to move my application up at site level, so that the name of the subfolder would not appear in the URL. It sounds quite obvious now but my first attempts to do that where unsuccessful, so I thought it wasn't possible. As Gerald said, all is explained in his answer to my other question : Invisible redirection to IIS site


0

Fix your sub-host. proxy-pass won't re-write responses coming from the other web-server. So, if the other-server (on port 3000) gives hrefs and links to URLs without proper paths, you'll see exactly what you've got. i.e. your localhost:3000 server is returning links to https://localhost:3000/en/collections.html instead of https://localhost:3000/vocab/arch/...


1

The URI is received by Nginx with certain characters URL encoded. However, Nginx normalizes the URI before processing it against location and rewrite statements, so the %20 has been converted back to a literal space. To handle expressions with embedded spaces, braces or semicolons, use quotes. For example: rewrite "^/my url/?$" /my-url permanent;


0

The below rules can be applied in IIS for the problem ...


-2

To peform htaccess redirect to HTTPS, you need to Install SSL certificate. After successful installation of SSL, the first step involves editing of .htaccess file. You can do it via FTP or cPanel File Manager. The second step involves htaccess redirect to https in Apache or NGINX. Visit https://serverguy.com/security/redirect-http-to-https/ for complete ...


0

The probalem was with my nodeJS server. I was using HapiJS and the default socket timeout is 2 minutes. All you have to do is set it to whatever timeout you need.


1

tl;dr A request for /contact/ (or /contact/blah) results in a rewrite loop (500 Internal Server Error response) because REQUEST_FILENAME contains the mapped filesystem path; not the URL-path you are expecting. RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html The "problem" is the use of REQUEST_FILENAME ...


1

%{REQUEST_URI} will probably just match the last path in the URI (index.html). You probably want to try with %{THE_REQUEST} instead: <If "%{THE_REQUEST} =~ m#^/bst/index\.html#"> Header set X-Akamai Yes </If>


0

Thanks to @alexey-ten's comment, the following worked: server { listen 80; server_name *.example.com; return 301 https://$host$request_uri; } server { listen 443 ssl; ssl_certificate /etc/ssl/examplecom_bundle.crt; ssl_certificate_key /etc/ssl/examplecom.key; server_name ~^(?<subdomain>(bar|baz))\.example\.com$; ...


0

You should take a look at installing the IIS Rewrite Module https://www.iis.net/downloads/microsoft/url-rewrite This is designed to accept inbound URLs that you want to modify before processing. eg, if you need to redirect to a different server, page or port. Useful to use a UI if you aren't able to modify the web.config (or you don't want to, eg, when its ...


0

I believe a work around using DirectoryIndex instead of FallbackResource might also work. The following will match /a/script/ to the file /some/path/to/a/script/index.py then /some/path/to/a/script/index.html then /some/path/to/subfolder/index.py and finally /some/path/index.py. This relies upon DirectoryIndex honouring absolute paths. ScriptAlias / "/...


1

I could find the answers myself. This will help someone in future. For Q1: location / { if ($arg_test ~* yes) { return 301 https://sub2.domain.com/v2/page/embed?new=1; } } For Q2: location / { if ($arg_test ~* yes) { rewrite ^(.*)$ https://sub2.domain.com$1; } }


1

You can use: server { # Permanent redirect to an individual page rewrite ^/oldpage$ newpage permanent; }


Top 50 recent answers are included