Skip to content

Commit 797fea8

Browse files
committed
Docker image and configuration update
1 parent 111cbe9 commit 797fea8

File tree

3 files changed

+59
-5
lines changed

3 files changed

+59
-5
lines changed

docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
volumes:
3131
- ./:/var/www/html/
3232
links:
33-
- db:mysql
33+
- db
3434
depends_on:
3535
- db
3636
networks:

nginx-docker.conf

+57-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
server {
22
listen 0.0.0.0:80;
33

4+
#listen 80 server;
5+
#listen [::]:80 server;
6+
#listen 443 ssl http2;
7+
#listen [::]:443 ssl http2;
8+
9+
#ssl_certificate /etc/letsencrypt/live/vvveb.com/fullchain.pem;
10+
#ssl_certificate_key /etc/letsencrypt/live/vvveb.com/privkey.pem;
11+
#ssl_session_cache shared:SSL:20m;
12+
#ssl_session_timeout 10m;
13+
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
14+
#ssl_prefer_server_ciphers on;
15+
#ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
16+
417
error_log /var/log/nginx/error.log;
518
access_log /var/log/nginx/access.log;
619

@@ -9,6 +22,21 @@ server {
922
index index.php index.html;
1023
error_page 404 /index.php;
1124

25+
gzip on;
26+
gzip_vary on;
27+
gzip_min_length 10240;
28+
gzip_proxied any;
29+
gzip_comp_level 6;
30+
gzip_buffers 16 8k;
31+
gzip_http_version 1.1;
32+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
33+
34+
#charset utf-8;
35+
36+
add_header X-Frame-Options "SAMEORIGIN";
37+
add_header X-XSS-Protection "1; mode=block";
38+
add_header X-Content-Type-Options "nosniff";
39+
1240
set $skip_cache 0;
1341
set $cache_uri $request_uri;
1442

@@ -37,7 +65,23 @@ server {
3765
}
3866

3967
#static files
40-
location ~* "\.(?!php)([\w]{3,4})$" {
68+
#error_page 404 /index.php;
69+
#error_page 404 /404.html;
70+
71+
location = /favicon.ico {
72+
log_not_found off;
73+
access_log off;
74+
}
75+
76+
#add domain to sitemaps for multisite
77+
location = /robots.txt {
78+
log_not_found off;
79+
access_log off;
80+
try_files $uri /index.php$is_args$args;
81+
}
82+
83+
#static files
84+
location ~* "\.(?!php)([\w]{3,5})$" {
4185
expires max;
4286
log_not_found off;
4387
sendfile on;
@@ -50,21 +94,31 @@ server {
5094
location / {
5195
default_type text/html;
5296
index index.php index.html index.htm;
53-
try_files /page-cache/$http_host$cache_uri /page-cache/$http_host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
97+
try_files /page-cache/$host$cache_uri /page-cache/$host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
5498
#try_files $uri $uri/ /index.php$is_args$args;
5599

56100
#cache debug
57101
#add_header "uri" $cache_uri;
102+
#add_header "skip_cache" $skip_cache;
103+
104+
location ~ /media/.+?\.php$ {
105+
deny all;
58106
}
59107

60108
location ~ \.php$ {
61109
# try_files $uri =404;
62110

63111
#fastcgi_pass unix:/var/run/php-fpm83/php-fpm.pid;
64-
fastcgi_pass php:9000;
112+
#fastcgi_pass php:9000;
113+
fastcgi_pass 127.0.0.1:9000;
65114
fastcgi_index index.php;
66115
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
67116
fastcgi_param PATH_INFO $fastcgi_path_info;
68117
include fastcgi_params;
118+
}
119+
}
120+
121+
location ~ /\.(?!well-known).* {
122+
deny all;
69123
}
70124
}

nginx-live.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ server {
118118
location / {
119119
default_type text/html;
120120
index index.php index.html index.htm;
121-
try_files /page-cache/$http_host$cache_uri /page-cache/$http_host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
121+
try_files /page-cache/$host$cache_uri /page-cache/$host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
122122
#try_files $uri $uri/ /index.php$is_args$args;
123123

124124
#cache debug

0 commit comments

Comments
 (0)