Welcome! Log In Create A New Profile


SSL issues with PHP over HTTPS

Posted by viralpoet 
SSL issues with PHP over HTTPS
March 03, 2017 01:59PM
I'm suffering in trying to get my test server up as SSL in readiness for my main server to move across.
Non php pages display ok. I've got the forced www redirect working and the https redirect working, but as soon as I go to view a php file using https I get a page not found.

This is my mail nginx.conf file

user nginx;
worker_processes auto;
#worker_priority -10;
worker_rlimit_nofile 100000;

timer_resolution 100ms;
pcre_jit on;

error_log /var/log/nginx/error.log crit;
pid /var/run/nginx.pid;

events {
worker_connections 3500;
use epoll;
#accept_mutex on;
#accept_mutex_delay 200ms;
multi_accept on;

http {

server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
server_name domain.com www.domain.com;
ssl on;
ssl_certificate /etc/nginx/ssl/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/myserver.key;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
if ($scheme = http) {
return 301 https://www.domain.com$request_uri;

# Config for Free SSL (LetEncrypt) - Do not Delete !
location ~ /.well-known {
allow all;
root /home/domain.com/public_html;

location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 256k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME /home/domain.com/public_html$fastcgi_script_name;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;

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


include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf/ddos1.conf;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
more_set_headers "Server: Nginx";
more_set_headers "X-Powered-By: VPSSIM"
access_log off;
sendfile on;
sendfile_max_chunk 512k;
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 48
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready