optrex
Well-known member
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
I'd also like to add the rewites for freindly urls.
I'd appreciate some help as to where I've gone wrong please. Cheers
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
I'd also like to add the rewites for freindly urls.
Code:
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_pass 127.0.0.1:9000;
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;
I'd appreciate some help as to where I've gone wrong please. Cheers