server { listen 80 default_server; listen 443 ssl; root /config/www; index index.html index.htm index.php; server_name _; ssl_certificate /config/keys/cert.crt; ssl_certificate_key /config/keys/cert.key; client_max_body_size 0; location / { if ($request_uri ~ ^/(.*)\.html) { return 302 /$1; } try_files $uri $uri.html $uri/ =404; } location ~ ^(.+\.php)(.*)$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /etc/nginx/fastcgi_params; } error_page 404 /404-error.html; }