「✨」 feat: Should be working
This commit is contained in:
9
srcs/configs/nginx/entry/cert-gen.sh
Executable file
9
srcs/configs/nginx/entry/cert-gen.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -f ${NGINX_SSL_KEY_FILE} ]; then
|
||||
echo "Generating certs"
|
||||
mkdir -p /etc/nginx/ssl
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${NGINX_SSL_KEY_FILE} -out ${NGINX_SSL_CERT_FILE} -subj "/C=FR/ST=IDF/L=Angouleme/O=42/OU=42/CN=adjoly.42.fr/UID=adjoly"
|
||||
else
|
||||
printf "Key already exist not recreating\n"
|
||||
fi
|
@ -1,19 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name adjoly.42.fr;
|
||||
root /var/www/html;
|
||||
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass php-fpm:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
26
srcs/configs/nginx/templates/www.conf.template
Normal file
26
srcs/configs/nginx/templates/www.conf.template
Normal file
@ -0,0 +1,26 @@
|
||||
server {
|
||||
listen 443 ssl;
|
||||
|
||||
server_name adjoly.42.fr www.adjoly.42.fr;
|
||||
|
||||
root /var/www/html/;
|
||||
index index.php;
|
||||
|
||||
ssl_certificate $NGINX_SSL_CERT_FILE;
|
||||
ssl_certificate_key $NGINX_SSL_KEY_FILE;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_timeout 10m;
|
||||
|
||||
keepalive_timeout 60;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi.conf;
|
||||
fastcgi_pass $NGINX_PHP_HOST:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 'healthy';
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user