server {
    real_ip_header proxy_protocol;
    set_real_ip_from 100.82.192.249;

    listen 80;
    server_name squattheplanet.com www.squattheplanet.com;

    client_max_body_size 512M;

    add_header X-Xss-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;

    root /var/www/html;

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

    location /install/data/ {
        internal;
    }

    location /install/templates/ {
        internal;
    }

    location /internal_data/ {
        internal;
    }

    location /library/ {
        internal;
    }

    location /src/ {
        internal;
    }

    rewrite ^/chat(.*)$ https://discordapp.com/invite/R6Hwjmh permanent;
    rewrite ^/shop(.*)$ https://www.etsy.com/shop/SquatThePlanet permanent;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTP_PROXY_PROTOCOL $http_proxy_protocol; # Add this line
    }
}