Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

HTTPS/SSL Issue

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
alikamran
Posts: 16
Joined: Tue May 03, 2016 10:54 am

HTTPS/SSL Issue
  • Quote

Post by alikamran » Sat Jul 23, 2016 10:01 pm

I am having issues setting up SSL for one of my website. First of all, let me explain my setup; I am running CentOS 7, Nginx, PHP-FPM, and Vesta CP. The website I am trying to setup is built on WordPress and uses CloudFlare. I have completely installed the SSL certificate (StartSSL) on the domain in Vesta CP. Then I turned the CloudFlare SSL setting to "Full (Strict)" and installed a WP plugin to force HTTPS across the website. Now with everything setup, the home page of the WordPress website works fine in the https form and the green padlock shows in the browser but as soon as I open a post, it gives a 404 (server's 404 page shows up). Turning off the WP permalinks fixes this issue but permalinks are necessary so I cant turn them off.

I am also attaching my Nginx config file below. After the process mentioned above, the website does not redirect automatically from non-http to https version but if you specifically open the https version, the home page works fine but the posts/pages don't. Furthermore, due to the way I setup the website, the domain in Vesta CP is non-www but previously I was using www version on the old server so I added a redirect in the Nginx config to 301 all non-www requests to www version.

Any help will be highly appreciated.

SpoilerShow
server {
listen xx.xxx.xx.xx:xx;
server_name chiploco.com;
return 301 $scheme://www.chiploco.com$request_uri;
}
server {
listen xx.xxx.xx.xx:xx;
server_name http://www.chiploco.com;
root /home/admin/web/chiploco.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/chiploco.com.log combined;
error_log /var/log/nginx/domains/chiploco.com.error.log error;

location / {

location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}

location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}

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:9004;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}

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/chiploco.com/document_errors/;
}

location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}

include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;

include /home/admin/conf/web/nginx.chiploco.com.conf*;
}
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: HTTPS/SSL Issue
  • Quote

Post by skurudo » Tue Jul 26, 2016 8:31 am

Code: Select all

server_name http://www.chiploco.com;
This server_name looks not right.

Code: Select all

server {
listen xx.xxx.xx.xx:xx;
server_name chiploco.com www.chiploco.com;
return 301 https://$server_name$request_uri;
}
server {
listen xx.xxx.xx.xx:xx;
server_name chiploco.com www.chiploco.com;
root /home/admin/web/chiploco.com/public_html;
...

Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password