| Server IP : 65.1.209.187 / Your IP : 216.73.216.144 Web Server : nginx/1.24.0 System : Linux ip-172-31-5-206 6.14.0-1015-aws #15~24.04.1-Ubuntu SMP Tue Sep 23 22:44:48 UTC 2025 x86_64 User : ( 1001) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /etc/nginx/sites-enabled/ |
Upload File : |
##
## 1) HTTP non-www -> HTTPS www
##
server {
listen 80;
listen [::]:80;
server_name trivandrumtennisclub.com;
return 301 https://www.trivandrumtennisclub.com$request_uri;
}
##
## 2) HTTP www -> HTTPS www
##
server {
listen 80;
listen [::]:80;
server_name www.trivandrumtennisclub.com;
return 301 https://www.trivandrumtennisclub.com$request_uri;
}
##
## 3) HTTPS non-www -> HTTPS www
##
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name trivandrumtennisclub.com;
ssl_certificate /etc/letsencrypt/live/trivandrumtennisclub.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/trivandrumtennisclub.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
return 301 https://www.trivandrumtennisclub.com$request_uri;
}
##
## 4) MAIN SITE: HTTPS www -> WordPress
##
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name www.trivandrumtennisclub.com;
root /var/www/ttc_wordpress;
index index.php index.html index.htm;
# Allow large uploads (WordPress media)
client_max_body_size 2000M;
# SSL (Certbot)
ssl_certificate /etc/letsencrypt/live/trivandrumtennisclub.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/trivandrumtennisclub.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# ------------------------------------------------------------------
# BEGIN CompressX (place BEFORE other location blocks)
# ------------------------------------------------------------------
set $ext_avif ".avif";
if ($http_accept !~* "image/avif") {
set $ext_avif "";
}
set $ext_webp ".webp";
if ($http_accept !~* "image/webp") {
set $ext_webp "";
}
location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif|webp)$ {
add_header Vary Accept;
add_header Cache-Control "private";
expires 365d;
try_files
/wp-content/compressx-nextgen/$path.$ext$ext_avif
/wp-content/compressx-nextgen/$path.$ext$ext_webp
/wp-content/$path.$ext
$uri =404;
}
# ------------------------------------------------------------------
# END CompressX
# ------------------------------------------------------------------
# WordPress permalinks
location / {
try_files $uri $uri/ /index.php?$args;
}
# PHP handling (PHP-FPM)
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Cache static assets (IMPORTANT: removed jpg/jpeg/png/gif/webp so CompressX can handle them)
location ~* \.(css|js|ico|svg|ttf|otf|eot|woff|woff2)$ {
expires 30d;
access_log off;
try_files $uri =404;
}
# Deny access to hidden files (.env, .git, etc.) but allow Let's Encrypt
location ~ /\.(?!well-known).* {
deny all;
}
# Protect wp-config.php
location = /wp-config.php {
deny all;
}
# Block PHP execution in uploads
location ~* ^/wp-content/uploads/.*\.php$ {
deny all;
}
}