feat: nginx conf template

This commit is contained in:
Lenoctambule
2026-04-02 14:26:53 +02:00
parent 66f115a2e2
commit 321d078167
4 changed files with 62 additions and 44 deletions

View File

@@ -1,34 +0,0 @@
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/certs/nginx-selfsigned.key;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
server
{
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server
{
listen 443 ssl default_server;
return 301 https://rralambo.42.fr$request_uri;
}
server
{
listen 443 ssl;
server_name rralambo.42.fr;
index index.php index.html index.htm;
root /var/www/wordpress;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass wordpress:9000;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

View File

@@ -0,0 +1,39 @@
server {
listen 80;
server_name ${APP_DOMAIN};
location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
}
server {
listen 443 ssl;
server_name ${APP_DOMAIN};
server_tokens off;
client_max_body_size 20M;
index index.php index.html index.htm;
root /var/www/wordpress;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_certificate /etc/letsencrypt/live/${APP_DOMAIN}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${APP_DOMAIN}/privkey.pem;
# include /etc/letsencrypt/options-ssl-nginx.conf;
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass wordpress:9000;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}