Update docker nginx configuration
This commit is contained in:
parent
deb0156c1b
commit
b91381e822
@ -1,4 +1,4 @@
|
||||
FROM nginx:mainline-alpine-slim
|
||||
|
||||
RUN rm /etc/nginx/nginx.conf
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
COPY . /site
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/site.conf
|
46
nginx.conf
46
nginx.conf
@ -1,10 +1,42 @@
|
||||
server {
|
||||
index index.php index.html;
|
||||
server_name fredboniface.co.uk.local;
|
||||
error_log /var/log/nginx/error.log;
|
||||
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;
|
||||
keepalive_timeout 65;
|
||||
gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
root /site;
|
||||
|
||||
location ~ /(.git|php|page-blocks) {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri $uri/ $uri/index.php &uri/index.html =404;
|
||||
break;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
@ -14,4 +46,10 @@ server {
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
|
||||
error_page 403 /error-pages/403.php;
|
||||
error_page 404 /error-pages/404.php;
|
||||
error_page 500 501 502 503 504 /error-pages/50x.html;
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user