Skip to content

Commit 0e49ffa

Browse files
author
Automation
committed
fix: correct nginx config structure for standalone nginx.conf
1 parent da71227 commit 0e49ffa

2 files changed

Lines changed: 38 additions & 22 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ COPY . /var/www/html
3030
COPY --from=vendor /app/vendor /var/www/html/vendor
3131

3232
# Nginx and Supervisor configuration
33-
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
33+
COPY docker/nginx/default.conf /etc/nginx/nginx.conf
3434
COPY docker/supervisord.conf /etc/supervisord.conf
3535

3636
# Permissions

docker/nginx/default.conf

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,46 @@
1-
server {
2-
listen 8080;
3-
server_name _;
1+
events {
2+
worker_connections 1024;
3+
}
44

5-
root /var/www/html/public;
6-
index index.php index.html;
5+
http {
6+
include /etc/nginx/mime.types;
7+
default_type application/octet-stream;
78

8-
access_log /var/log/nginx/access.log;
9-
error_log /var/log/nginx/error.log warn;
9+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
10+
'$status $body_bytes_sent "$http_referer" '
11+
'"$http_user_agent" "$http_x_forwarded_for"';
1012

11-
location / {
12-
try_files $uri $uri/ /index.php?$query_string;
13-
}
13+
access_log /var/log/nginx/access.log main;
14+
error_log /var/log/nginx/error.log warn;
1415

15-
location ~ \.php$ {
16-
include fastcgi_params;
17-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
18-
fastcgi_pass 127.0.0.1:9000;
19-
fastcgi_index index.php;
20-
}
16+
sendfile on;
17+
keepalive_timeout 65;
2118

22-
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2)$ {
23-
expires 30d;
24-
add_header Cache-Control "public, no-transform";
25-
}
19+
server {
20+
listen 8080;
21+
server_name _;
22+
23+
root /var/www/html/public;
24+
index index.php index.html;
2625

27-
client_max_body_size 20m;
26+
location / {
27+
try_files $uri $uri/ /index.php?$query_string;
28+
}
29+
30+
location ~ \.php$ {
31+
include fastcgi_params;
32+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
33+
fastcgi_pass 127.0.0.1:9000;
34+
fastcgi_index index.php;
35+
}
36+
37+
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2)$ {
38+
expires 30d;
39+
add_header Cache-Control "public, no-transform";
40+
}
41+
42+
client_max_body_size 20m;
43+
}
2844
}
2945

3046

0 commit comments

Comments
 (0)