Re: Forward ip to domain - SSL
Posted: Tue May 12, 2015 7:20 pm
In your domain folder..hafeezksa wrote: Where to keep this .htaccess file ?
/home/user/web/yourdomain.tld/public_html
In your domain folder..hafeezksa wrote: Where to keep this .htaccess file ?
Actually I want to redirect my VPS IP to a domain name I did it in /usr/local/vesta/nginx/conf/nginx.confskurudo wrote:In your domain folder..hafeezksa wrote: Where to keep this .htaccess file ?
/home/user/web/yourdomain.tld/public_html
There already is recipe how tohafeezksa wrote:Actually I want to redirect my VPS IP to a domain name I did it in /usr/local/vesta/nginx/conf/nginx.conf
It is ok when I use https+IP, it redirecting to my ssl site, but when I use http+IP without ssl it is redirecting to my an other domain (without ssl). I want to redirect IP to my ssl site even with http or https, how to do that ?
With ssl doamin there is no any problem its ok. Actually, I want to redirect my vps ip to my https site for example if I use this IP URLskurudo wrote:There already is recipe how tohafeezksa wrote:Actually I want to redirect my VPS IP to a domain name I did it in /usr/local/vesta/nginx/conf/nginx.conf
It is ok when I use https+IP, it redirecting to my ssl site, but when I use http+IP without ssl it is redirecting to my an other domain (without ssl). I want to redirect IP to my ssl site even with http or https, how to do that ?
https://vestacp.com/docs/#how-to-force-https
Code: Select all
error_page 497 https://mydoamin.com;
I add this code after restarting vesta service, I am not able to start vesta service even I remove this code from conf file.skurudo wrote:Try something like this in /etc/nginx/conf.d/yourip.confCode: Select all
error_page 497 https://mydoamin.com;
Code: Select all
/etc/init.d/apache2 stop
/etc/init.d/nginx stop
/etc/init.d/nginx start
/etc/init.d/apache2 start
Regarding error in my above post, there was my mistake some days ago in nginx.conf I changed (under Vhost) vesta port from 8083 to 80 and I forget to return it. The problem was fixed.skurudo wrote:Where you exactly put this string?Code: Select all
/etc/init.d/apache2 stop /etc/init.d/nginx stop /etc/init.d/nginx start /etc/init.d/apache2 start
Oh, so it is ;-) Nice.hafeezksa wrote: Regarding error in my above post, there was my mistake some days ago in nginx.conf I changed (under Vhost) vesta port from 8083 to 80 and I forget to return it. The problem was fixed.
hafeezksa wrote:With ssl doamin there is no any problem its ok. Actually, I want to redirect my vps ip to my https site for example if I use this IP URLskurudo wrote:There already is recipe how tohafeezksa wrote:Actually I want to redirect my VPS IP to a domain name I did it in /usr/local/vesta/nginx/conf/nginx.conf
It is ok when I use https+IP, it redirecting to my ssl site, but when I use http+IP without ssl it is redirecting to my an other domain (without ssl). I want to redirect IP to my ssl site even with http or https, how to do that ?
https://vestacp.com/docs/#how-to-force-https
http://192.168.1.10 it should redirect to my domain https://mydoamin.com
http://192.168.1.10 (not working) ?
https://192.168.1.10 (working and redirecting ok)
Code: Select all
server {
listen [IP ADDRESS]:80 default;
server_name _;
access_log /var/log/nginx/[IP ADDRESS].log main;
location / {
return 301 https://DOMAINNAME.com;
}
}