We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
HTTPs/SSL on Nginx + Php-fpm and Wordpress Topic is solved
HTTPs/SSL on Nginx + Php-fpm and Wordpress
Hello Everyone,
I've recently decided to move from a very bad hosting to my own VPS. So far it was quite an adventure but I must say I'm really happy with the results and all the stuff I am quickly learning.
I feel like I have a lot of stuff to learn, and I found myself stuck in a very annoying situation.
So... I'm running wordpress on one of my websites, misuracaceramiche.it but I cannot manage to make SSL/HTTPS work on it.
It's probably a beginner mistake, but the only thing I've made to enable it is to check "SSL Support" and "Lets Encrypt Support" on the Web > Domain configuration on VestaCP and then I've tried to change the url on Wordpress (admin Panel) from http://misuracaceramiche.it to https://misuracaceramiche.it resulting in error "Too many Redirects"
I'm also using cloudflare at the moment, but I've turned off SSL and using developer mode!
I've tried this: https://vestacp.com/docs/#how-to-force-https
But I'm not sure how to do step 3-4-5. Should I have the force-https template when creating a new package on VestaCP? Should it be there when editing a domain configuration? Because I can't see it there.
I've also tried to edit my website's Nginx.conf file but probably failed with this.
This is the misuracaceramiche.it.nginx.conf file, located in home/user/conf/web
Other files in that folder:
mywebsite.nginx.ssl.conf
nginx.mywebsite.conf_letsencrypt
snginx.mywebsite.com.conf_letsencrypt
ssl.mywebsite.co.ca
ssl.mywebsite.com.crt
ssl.mywebsite.com.key
ssl.mywebsite.com.pem
I've recently decided to move from a very bad hosting to my own VPS. So far it was quite an adventure but I must say I'm really happy with the results and all the stuff I am quickly learning.
I feel like I have a lot of stuff to learn, and I found myself stuck in a very annoying situation.
So... I'm running wordpress on one of my websites, misuracaceramiche.it but I cannot manage to make SSL/HTTPS work on it.
It's probably a beginner mistake, but the only thing I've made to enable it is to check "SSL Support" and "Lets Encrypt Support" on the Web > Domain configuration on VestaCP and then I've tried to change the url on Wordpress (admin Panel) from http://misuracaceramiche.it to https://misuracaceramiche.it resulting in error "Too many Redirects"
I'm also using cloudflare at the moment, but I've turned off SSL and using developer mode!
I've tried this: https://vestacp.com/docs/#how-to-force-https
But I'm not sure how to do step 3-4-5. Should I have the force-https template when creating a new package on VestaCP? Should it be there when editing a domain configuration? Because I can't see it there.
I've also tried to edit my website's Nginx.conf file but probably failed with this.
This is the misuracaceramiche.it.nginx.conf file, located in home/user/conf/web
Code: Select all
server {
listen 80;
server_name misuracaceramiche.it www.misuracaceramiche.it;
root /home/admin/web/misuracaceramiche.it/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/misuracaceramiche.it.log combined;
access_log /var/log/nginx/domains/misuracaceramiche.it.bytes bytes;
error_log /var/log/nginx/domains/misuracaceramiche.it.error.log error;
location / {
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
try_files $uri $uri/ /index.php$args;
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias /home/admin/web/misuracaceramiche.it/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
mywebsite.nginx.ssl.conf
nginx.mywebsite.conf_letsencrypt
snginx.mywebsite.com.conf_letsencrypt
ssl.mywebsite.co.ca
ssl.mywebsite.com.crt
ssl.mywebsite.com.key
ssl.mywebsite.com.pem
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: HTTPs/SSL on Nginx + Php-fpm and Wordpress
Welcome Sanana94,
I understand your beginner problems... we will assist with the best we can.
First,
remove any customisations you did on Nginx.conf, or probably rebuild web for your user to reset it. Keep your SSL + Lets encrypt option checked...!
Second,
Go into your WP-Admin and
change your SITE URL to HTTPS https://misuracaceramiche.it/
Goto Permalinks and put Select the first option date wise. Save... then switch to post name URL... save again
Delete the htaccess in your site root
Then open your site in chrome inconginot mode to see if https site loads fine.
I understand your beginner problems... we will assist with the best we can.
First,
remove any customisations you did on Nginx.conf, or probably rebuild web for your user to reset it. Keep your SSL + Lets encrypt option checked...!
Second,
Go into your WP-Admin and
change your SITE URL to HTTPS https://misuracaceramiche.it/
Goto Permalinks and put Select the first option date wise. Save... then switch to post name URL... save again
Delete the htaccess in your site root
Then open your site in chrome inconginot mode to see if https site loads fine.
Re: HTTPs/SSL on Nginx + Php-fpm and Wordpress
Hello and thank you for the very fast reply!mehargags wrote: ↑Sun May 20, 2018 7:52 pmWelcome Sanana94,
I understand your beginner problems... we will assist with the best we can.
First,
remove any customisations you did on Nginx.conf, or probably rebuild web for your user to reset it. Keep your SSL + Lets encrypt option checked...!
Second,
Go into your WP-Admin and
change your SITE URL to HTTPS https://misuracaceramiche.it/
Goto Permalinks and put Select the first option date wise. Save... then switch to post name URL... save again
Delete the htaccess in your site root
Then open your site in chrome inconginot mode to see if https site loads fine.
Okay, i've done everything and also completely removed cloudflare. It seems that this one was causing all the troubles redirecting to http. Maybe because I've deactivated cloudflare SSL? Can I keep both of them?
Now it does not seem to work correctly, I'm having the issue where old pages get 404. In order to fix that, I've put try_files $uri $uri/ /index.php on my websites.nginx.conf file.
Should I do this for the website.nginx.ssl.conf ?
EDIT: I've put try_files $uri $uri/ /index.php on that file and now I'm on HTTPS!
It says Not secure even if the certificate is okay, what am I doing wrong now?
Feel free to check here and there: https://misuracaceramiche.it
Again, thanks everyone for the huge support with this!
Update: It works fine now. It was Cloudlfare, than had to remove HTTP calls on my pages. Thanks! :)
Feel Free to close this!