w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
nginx proxy based on host when using https
according to http://www.informit.com/articles/article.aspx?p=1994795, you should indeed have two "server" sections, with two different server names. In each one, you should include your ssl_* directives.

Categories : Ssl

Nginx https redirects - stop further rules processing
I usually like to use return instead of rewrite for redirects, try matching the path with a location block location ~ /path/resource(.*) { return 301 $scheme://newdomain.com/newpath/resource$1; } I think this way you know for sure there will be no further processing, because it's only 1 line, try it and tell me how it goes. PS: This will maintain the $scheme of the request, requests to http:// will be redirected to a http:// and https:// will be redirected to https://

Categories : Http

Nginx serving non-secure resources on https domain
maybe cause this is how they are called, if you need to serve every thing as https, i would create an empty server that listens on 80 and redirect to https server { # listen 80; delete this part listen 443 ssl; # the rest of the config } # add this server server { listen 80; server_name example.com; location / # or a more specific location '~ .(jpg|css|js|jpeg|png|gif)' { return https://example.com$request_uri; } } or just fix the css location, it might be an absolute URL with http

Categories : Magento

Websocket location mismatch when Safari 5.0 connects via nginx https proxy
Nginx websocket proxy only works for RFC6455 compliant handshakes. The older draft 75/76 handshakes, found in Safari 5 and old versions of chrome can't be proxied through nginx. Some more details here: Nginx: Reverse proxying WebSocket Draft 76

Categories : Nginx

Redirect all http AND https non-www URLS to https://www.xyz.com via htaccess
In case anyone from the future (HELLO PEOPLE OF THE FUTURE) stumble across this, I asked the same question and had it answered over at Server Fault. Short version: impossible. Long version: http://serverfault.com/questions/523199/redirect-all-http-and-https-non-www-urls-to-https-www-example-com-via-htaccess

Categories : Htaccess

Change CakePHP default redirect from HTTP to HTTPS?
You can use SecurityComponent::requireSecure (See) to force SSL for all actions, but as said before SSL should be enabled / supported on/by your webserver. It seems to me that this is not really a CakePHP problem.

Categories : PHP

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

IHttpHandler to redirect "https://example.com" to "https://www.example.com"?
If you use IIS7, you might want to try URL Rewrite Module. http://www.4guysfromrolla.com/articles/072810-1.aspx http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

Categories : Asp Net

How to redirect from url: https://myfavourite.test.com/Account/LogOn?ReturnUrl=/ to url: https://myfavourite.test.com/ using IIS7.5
I followed the steps mentioned in the below mentioned article and it helped me. http://www.trainsignal.com/blog/iis7-url-rewrite-extension-on-windows-server-2008 I used the Redirect option and then added a Blank rule with the following regular expression: account$|account/(?!LogOff) and that helped me to resolve the redirection issue.

Categories : Asp Net Mvc

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

Facebook like button https issue: protocol mismatch from http and https
Reviewing the js code on Facebook there are multiple urls containing hard coded strings for http://static .../rsrc.php it's possible those are the files triggering the error. This may be something Facebook needs to update. On a side note, it may be possible to download that js file from Facebook and store it on your server and remove the hard coded http string. I would test this further but I am on my phone at the moment.

Categories : Facebook

Once https page is visited, all subsequent pages are served from https
ok I think I found the reason. The links I am visiting are relative, so "/forum" for example. Once https is in the browser it seems like visiting a relative address is leaving the root as https:// and appending the relative path. I believe the fix here will be to use the full path for the link instead of relative.

Categories : Htaccess

How do you enable https and http->https redirects in ring / compojure
It's possible to serve HTTPS with clojure, but it's much more popular to put nginx or something like that in front of your ring server. If you can figure out how to configure jetty, though, run-jetty clearly supports SSL.

Categories : Http

when using https, https can't find codeigniter controllers. Running Centos
Change this line : RewriteRule ^(.*)$ index.php?/$1 [L] to : RewriteRule ^(.*)$ /index.php?/$1 [L] The .htaccess would otherwise be redirected relatively to a index.php in the join folder, which off course is not there.

Categories : PHP

How can i convert links to https when server providing https?
If you remove the http:// portion and use instead: <script type="text/javascript" src="//static.monstermmorpg.com/js_files/jquery-1.9.1.min.js"></script> It should request based on the current scheme being used.

Categories : C#

Can https fallback to http and security level of https
No, HTTPS never falls back to HTTP automatically. It would take deliberate action by the user. If you're just going to a web page by putting its URL into the address bar, this is easy; for form submission it's harder. Yes, sending plain text over SSL is fine. In fact, sending a hashed password doesn't really increase security much at all -- if someone manages to sniff the connection and gets the hashed password, that's all they need to be able to login to the site. It has one small advantage: if the user uses the same password at multiple sites, learning the hashed password for one site doesn't help them get into another site that uses a different (or no) hash. And it's not likely to be feasible to send salted hashes, since the client doesn't know the salt. A cnonce adds an extra level

Categories : Asp Net

How to redirect single url in nginx?
Put this in your server directive: location /issue { rewrite ^/issue(.*) http://$server_name/shop/issues/custom_issue_name$1 permanent; } Or duplicate it: location /issue1 { rewrite ^/.* http://$server_name/shop/issues/custom_issue_name1 permanent; } location /issue2 { rewrite ^.* http://$server_name/shop/issues/custom_issue_name2 permanent; } ...

Categories : Nginx

HTTPS GET request to https://www.googleapis.com/plus/v1/people/me
Create a Google_Oauth2Service object (put it under the $plus initialization), like: $client = new Google_Client(); $plus = new Google_PlusService($client); $oauth2 = new Google_Oauth2Service($client); and after succesfully authenticating the client use: $userInfo = $oauth2->userinfo->get(); $email = $userInfo['email'];

Categories : PHP

Why is SSL redirect not working with force_ssl and Nginx?
First guess... the port 80 server block does not pass the host through, maybe that's it? proxy_set_header Host $http_host; The SSL block does, but if you start at the non-SSL side and Rails picks it up, it might not have the full header there?

Categories : Ruby On Rails

Nginx proxy redirect without changing url
first you're using 8000 in proxy_pass, but you're mentioning your port is 8080. Second, remove the rewrite line should do the trick, because youre actually using the rewrite rule here and never get to the proxy_pass line. Something like the following should work: location /assets/ { include proxy_params; proxy_pass http://127.0.0.1:8080; } There are also proxy_rewrite and proxy_redirect commands which might help you in getting this upstream-redirect handled internally by nginx. Hope that helps!

Categories : Nginx

How to use Nginx to redirect to specific page?
add in your t.example.com location { } something like: rewrite ^(.*) http://testing.example.com/test/$1 permanent; or just simple redirect return 301 http://testing.example.com/test/;

Categories : PHP

301 Rewrite Permanent Redirect in Nginx
In nginx change server_name from site1 to site2 and then create a new site1 block server { listen 80; server_name site1.com; location / { return 301 $scheme://site2.com$request_uri; } }

Categories : Nginx

nginx redirect only fails with firefox
Found the issue. Because the /blog redirected to HTTP and all other paths redirected to HTTPS, the problem was with the following configuration line: add_header Strict-Transport-Security max-age=500; When I commented out that line, the issue went away.

Categories : Firefox

Nginx proxy_pass with variables and redirect
I once had the same issue and what saved me was Nginx's resolver module try to add: resolver 8.8.8.8; before the proxy_pass line. It should allow you to work with variables. Also have a look at a similar question.

Categories : Nginx

SSL offloading redirect to https
You just send a normal redirect to the client. The response will be the sent out using the original http request and the new https request will terminate SSL at the load balancer as per normal.

Categories : Asp Net

Redirect HTTPS to HTTP and NON WWW to WWW
You can combine: RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} and RewriteCond %{HTTP_HOST} ^ties.co.uk$ RewriteRule (.*) http://www.ties.co.uk/$1 [R=301,L] into a single rule that needs to be right below RewriteEngine On: RewriteCond %{HTTPS} on [OR] RewriteCond %{HTTP_HOST} ^ties.co.uk$ [NC] RewriteRUle ^(.*)$ http://www.ties.co.uk/$1 [R=301,L]

Categories : Apache

nginx intercepting google oauth redirect
you have server_name quickerhub.com; the get request is coming back to http://www.quickerhub.com/?code=4/bzqKIpj3UA3bBiyJfQzi3svzPBLZ.QoB_rXWZ6hUbmmS0T3UFEsPMOFF4fwI quickerhub.com != www.quickerhub.com and so nginx is falling through to serving the default page (for when it can't find a vhost). all you need to do is use server_name www.quickerhub.com quickerhub.com; or even better, add this to "canonicalise" all your urls to the version without www. server { server_name www.quickerhub.com; expires epoch; add_header Cache-Control "no-cache, public, must-revalidate, proxy-revalidate"; rewrite ^ http://quickerhub.com$request_uri permanent; }

Categories : Python

Redirect request to two Upstream server in Nginx
Here's how i think your config could be, you can create multiple upstreams upstream main_upstream { server IP1 server IP2 server IP3 } upstream process_upstream { server IP2 server IP3 } server { location /process { proxy_pass http://process_upstream; } location / { proxy_pass http://main_upstream; }

Categories : Nginx

NGINX redirect rewrite "/([0-9]+)" /showthread.php?t=$1 break;
The problem is that you're trying to match something that doesn't exist in the URI, your regex exists in $args and $query_string, I'm not sure if this will work but you can try if ($args ~ "threads/.*.([0-9]+)$") { try_files /showthread.php?t=$1 =404; }

Categories : Nginx

using Mod_rewrite to redirect HTTP to HTTPS
are you trying it on localhost or on a live server? Redirect http to https (SSL for entire website) try this in .httaccess RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} or RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$ RewriteRule ^(.*)$ - [env=askapache:%2] # redirect urls with index.html to folder RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*index.html HTTP/ RewriteRule ^(([^/]+/)*)index.html$ http%{ENV:askapache}://%{HTTP_HOST}/$1 [R=301,L] # change // to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /(.*)//(.*) HTTP/ [NC] RewriteRule ^.*$ http%{ENV:askapache}://%{HTTP_HOST}/%1/%2 [R=301,L]

Categories : Apache

Redirect using HTTPS connection Response
Could you provide your connection code? As a generic approach,you can set the setInstanceFollowRedirect(false) for the HttpUrlConnection, so that the redirects don't go through and you can handle them manually. Here is a good example: http://www.mkyong.com/java/java-httpurlconnection-follow-redirect-example/

Categories : Java

In Pyramid how can I redirect from http to https?
Some unsolicited advice - Don't redirect to SSL from non-SSL. There's a security issue. Basically, if someone manages to Man-In-The-Middle your non-SSL'd service, they could redirect it to an SSL service running with a valid certificate on a different server - the user might not notice this. It's better to provide a page that warns the user and provides a plain-text link for them to click.

Categories : Python

Redirect a website from http to https
This solution helped me. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.name/$1 [R,L] </IfModule> I hope it'll be helpfull for you too.

Categories : Apache

Redirect to HTTP non-www to HTTPS www htaccess
Try it like this: RewriteEngine On RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301] The only real difference here is that first we redirect from non-WWW to WWW then we check for HTTPS and redirect it. If it does work then try this one: RewriteEngine On RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]

Categories : Htaccess

Redirect website from http to https
I can see that you've taken the code snipet from Steve Marx example The problem is that you have whitespace in your rule name. Just remove them and it will work. The name attribute of rule must not have spaces; the rule won’t work correctly in IIS on Azure with spaces in the name. Find the full article here: Azure https guide

Categories : C#

Redirect all images to its corresponding https site
Of course it loops - because the pattern matches for requests for the HTTPS versions as well (since only the url path component is checked). Add a RewriteCond that checks if the request came in via HTTPS.

Categories : Image

Default nginx conf file
I guess, first vhost would be used. If you use including virtual hosts (/etc/nginx/sites-enabled/*) the hosts would be included in alphabetical order. So, if you have hosts "a", "b" and "c", first of them will be "a".

Categories : Nginx

tomcat doesn't redirect http to https
I dare to claim that this is unrelated to tomcat - or how else does a cgi-script come into play? In case you've configured this yourself, look at the redirect.cgi script. It probably tries to determine the server's name. If you're using Apache httpd, this can typically be configured, otherwise apache defaults to the server's IP address as a name. In this case, Apache typically complains about the missing server name when starting up. Maybe related: The only place where I found (after a quick search) this redirect.cgi and arip parameter used, was in a ZyXel device - if you're using this one to redirect, that's what you need to configure. You might get more clues about the actual server by inspecting the HTTP response headers, e.g. with Firebug or a similar tool.

Categories : Tomcat

Redirect HTTP and HTTPS properly in htaccess
You aren't checking whether the incoming request is HTTPS or not. You can combine the two with a bit of clever regex grouping: <ifModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www2.mydomain.com$ [NC] RewriteCond %{HTTPS}:s (on:(s)|off:s) RewriteRule ^(.*)$ http%2://newmydomain.com/$1 [L,R=301] </ifModule> There isn't an %{HTTPS_HOST} variable, as it's the "Host:" request field. All the %{HTTP_(something)} variables are request fields, e.g. %{HTTP_USER_AGENT}, %{HTTP_COOKIE}, %{HTTP_REFERER}, are all request fields; User-Agent:, Cookie:, Referer:. The second condition checks if the request is HTTPS or not, and if so (on), it captures the "s" which is backreferenced by %2, thus turning the redirect to https://, otherwise, just http://.

Categories : Apache



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.