#1  
Old 30th November 2012, 22:27
Dodge Dodge is offline
Junior Member
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default [ISP3/Nginx] https only site

Hey there,

i just installed ISP3 on my new Server(Debian6) and so far everything is running fine, but while setting up my sites, i came across a small problem.

I want one of my sites https only. http requests should be redirected to https. https works without problems, bit i cant find a way to redirect http to https or disable http for that site at least.

i allready tried to use the isp redirect settings for my domain with the result of an endles redirect
i even tried to add a redirect block with the config option to add custom directives to nginx vhost config but that does not work as the block would be after the actual vhost block and so never matched as the block itself matches :/


so: is there a way to disable http or redirect http -> https?


thanks in advance
Reply With Quote
Sponsored Links
  #2  
Old 30th November 2012, 23:08
webguyz webguyz is offline
Senior Member
 
Join Date: Oct 2012
Location: Earth
Posts: 109
Thanks: 33
Thanked 15 Times in 12 Posts
Default

Perhaps something like this in the .htaccess at the root of your website:

-----------------------------------------------------------------
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]
-----------------------------------------------------------------
__________________
= WebGuyz.Net =
VPS and Web Hosting
Reply With Quote
  #3  
Old 1st December 2012, 15:29
Dodge Dodge is offline
Junior Member
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey webguyz,

thank you for your reply. but as i have written, i'm using nginx as webserver so there is no .htaccess support
Reply With Quote
  #4  
Old 1st December 2012, 15:36
webguyz webguyz is offline
Senior Member
 
Join Date: Oct 2012
Location: Earth
Posts: 109
Thanks: 33
Thanked 15 Times in 12 Posts
Default

Oops. Keep forgetting that about nginx. Must be why I use Apache, for compatability with the rest of the world

Good Luck!
__________________
= WebGuyz.Net =
VPS and Web Hosting
Reply With Quote
  #5  
Old 2nd December 2012, 11:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Use this in the nginx Directives field:

Code:
if ($scheme != "https") {
                rewrite ^ https://$host$request_uri? permanent;
}
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 2nd December 2012, 12:10
Dodge Dodge is offline
Junior Member
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by falko View Post
Use this in the nginx Directives field:

Code:
if ($scheme != "https") {
                rewrite ^ https://$host$request_uri? permanent;
}
works perfectly. thanks! )
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
haproxy with stunnel problem abubin Server Operation 6 10th April 2012 15:08
Site on other port, HTTPS, SSL dubak Installation/Configuration 2 11th March 2010 20:00
HTTPS site not working. suidas Installation/Configuration 3 7th May 2007 10:59
Unable to access https site for admin daveharris@rokcorp.com Installation/Configuration 2 7th March 2007 16:45
Pure https site erk Installation/Configuration 2 9th January 2006 20:45


All times are GMT +2. The time now is 14:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.