diff options
| author | Mathias Magnusson <mathias@magnusson.space> | 2025-09-22 21:25:49 +0200 |
|---|---|---|
| committer | Mathias Magnusson <mathias@magnusson.space> | 2025-09-22 21:25:49 +0200 |
| commit | a2827963fbf6847166360be635c65dc85d20dd0d (patch) | |
| tree | 3904f4a24733c4e097eb4baba4283973e5dabdbd /nginx.conf | |
| parent | fb59ea2f57da2abf3c7bd76feddfaf10e109d2f4 (diff) | |
| download | traedgaardstomten-a2827963fbf6847166360be635c65dc85d20dd0d.tar.gz | |
PHP FTW!
Diffstat (limited to 'nginx.conf')
| -rw-r--r-- | nginx.conf | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7c34523 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,34 @@ +server { + listen 8009; + server_name www.xn--trdgrdstomten-cfbr.se; + return 301 https://xn--trdgrdstomten-cfbr.se$request_uri; +} + +server { + listen 8009; + server_name xn--trdgrdstomten-cfbr.se; + root /var/www/trädgårdstomten/public; + set_real_ip_from 127.0.0.1/8; + gzip on; + default_type "text/html"; + + location / { + index index.php; + try_files $uri $uri/ @extless-php; + } + + location ~ \.php$ { + fastcgi_pass php:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + location @extless-php { + rewrite ^(/.*)/$ $1; + if (-f $document_root$uri.php) { + rewrite ^ $uri.php last; + } + return 404; + } +} |
