initial commit
This commit is contained in:
19
srcs/requirements/nginx/Dockerfile
Normal file
19
srcs/requirements/nginx/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM debian:buster
|
||||
|
||||
RUN apt update -y
|
||||
RUN apt install nginx -y
|
||||
RUN apt install openssl -y
|
||||
|
||||
RUN mkdir -p /etc/nginx/ssl
|
||||
|
||||
RUN openssl req -x509 -nodes -out /etc/nginx/ssl/inception.crt -keyout /etc/nginx/ssl/inception.key -subj "/C=FR/ST=CM/L=ANgouleme/O=42/OU=42/CN=vvaas/UID=vvaas"
|
||||
#create a non-encrypted SSL certificate
|
||||
COPY conf/nginx.conf /etc/nginx/conf.d
|
||||
# move the nginx config file in conf into the docker container
|
||||
RUN chmod +w /var/www/html
|
||||
RUN chown -R www-data:www-data /var/www/html
|
||||
|
||||
EXPOSE 443
|
||||
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
#start nginx
|
||||
20
srcs/requirements/nginx/conf/nginx.conf
Normal file
20
srcs/requirements/nginx/conf/nginx.conf
Normal file
@@ -0,0 +1,20 @@
|
||||
server {
|
||||
listen 0.0.0.0:443;
|
||||
|
||||
ssl on;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_certificate /etc/nginx/ssl/inception.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/inception.key;
|
||||
root /var/www/wordpress;
|
||||
server_name vvaas.42.fr;
|
||||
index index.php;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass wordpress:9000;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user