added nginx.conf to use git repo

This commit is contained in:
Florian Zirker 2024-04-05 06:29:51 +00:00
parent c817a4eaf3
commit 39ce8f5bec
2 changed files with 68 additions and 0 deletions

View file

@ -4,6 +4,7 @@ services:
image: nginx:stable
volumes:
- ${HTML}:/usr/share/nginx/html:ro
- $PWD/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- web
restart: unless-stopped

67
www/nginx.conf Normal file
View file

@ -0,0 +1,67 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# include /etc/nginx/conf.d/*.conf;
############################################
server {
listen 80;
listen [::]:80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# hide .git folder
location ~ /\.git {
deny all;
return 404;
}
location ~ /Readme.md {
deny all;
return 404;
}
}
# include /etc/nginx/conf.d/*.conf;
}