Skip to content

Commit 569d1a5

Browse files
authored
Sync Nginx config with upstream docs (#2476)
* Sync Nginx config with upstream docs Signed-off-by: Kaloyan Nikolow <tzerber@gmail.com> * Sync Nginx config with upstream docs Signed-off-by: Kaloyan Nikolow <tzerber@gmail.com> * Sync Nginx config with upstream docs Signed-off-by: Kaloyan Nikolow <tzerber@gmail.com> * Sync Nginx config with upstream docs Signed-off-by: Kaloyan Nikolow <tzerber@gmail.com> * Update nginx conf with upstream changes Signed-off-by: Kaloyan Nikolov <tzerber@gmail.com> * Remove application/wasm from nginx configuration Signed-off-by: Kaloyan Nikolov <tzerber@gmail.com> * Removed auto-added bracket from config file Signed-off-by: Kaloyan Nikolov <tzerber@gmail.com> --------- Signed-off-by: Kaloyan Nikolow <tzerber@gmail.com> Signed-off-by: Kaloyan Nikolov <tzerber@gmail.com>
1 parent 53d8159 commit 569d1a5

File tree

4 files changed

+8
-32
lines changed

4 files changed

+8
-32
lines changed

.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ http {
8383
add_header X-Frame-Options "SAMEORIGIN" always;
8484
add_header X-Permitted-Cross-Domain-Policies "none" always;
8585
add_header X-Robots-Tag "noindex, nofollow" always;
86-
add_header X-XSS-Protection "1; mode=block" always;
8786

8887
# Remove X-Powered-By, which is an information leak
8988
fastcgi_hide_header X-Powered-By;
@@ -162,26 +161,21 @@ http {
162161
fastcgi_pass php-handler;
163162

164163
fastcgi_intercept_errors on;
165-
fastcgi_request_buffering off;
164+
fastcgi_request_buffering on; # Required as PHP-FPM does not support chunked transfer encoding and requires a valid ContentLength header.
166165

167166
fastcgi_max_temp_file_size 0;
168167
}
169168

170169
# Serve static files
171-
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
170+
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
172171
try_files $uri /index.php$request_uri;
173172
add_header Cache-Control "public, max-age=15778463$asset_immutable";
174173
add_header Referrer-Policy "no-referrer" always;
175174
add_header X-Content-Type-Options "nosniff" always;
176175
add_header X-Frame-Options "SAMEORIGIN" always;
177176
add_header X-Permitted-Cross-Domain-Policies "none" always;
178177
add_header X-Robots-Tag "noindex, nofollow" always;
179-
add_header X-XSS-Protection "1; mode=block" always;
180178
access_log off; # Optional: Don't log access to assets
181-
182-
location ~ \.wasm$ {
183-
default_type application/wasm;
184-
}
185179
}
186180

187181
location ~ \.(otf|woff2?)$ {

.examples/docker-compose/insecure/postgres/fpm/web/nginx.conf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ http {
8383
add_header X-Frame-Options "SAMEORIGIN" always;
8484
add_header X-Permitted-Cross-Domain-Policies "none" always;
8585
add_header X-Robots-Tag "noindex, nofollow" always;
86-
add_header X-XSS-Protection "1; mode=block" always;
8786

8887
# Remove X-Powered-By, which is an information leak
8988
fastcgi_hide_header X-Powered-By;
@@ -162,26 +161,21 @@ http {
162161
fastcgi_pass php-handler;
163162

164163
fastcgi_intercept_errors on;
165-
fastcgi_request_buffering off;
164+
fastcgi_request_buffering on; # Required as PHP-FPM does not support chunked transfer encoding and requires a valid ContentLength header.
166165

167166
fastcgi_max_temp_file_size 0;
168167
}
169168

170169
# Serve static files
171-
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
170+
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
172171
try_files $uri /index.php$request_uri;
173172
add_header Cache-Control "public, max-age=15778463$asset_immutable";
174173
add_header Referrer-Policy "no-referrer" always;
175174
add_header X-Content-Type-Options "nosniff" always;
176175
add_header X-Frame-Options "SAMEORIGIN" always;
177176
add_header X-Permitted-Cross-Domain-Policies "none" always;
178177
add_header X-Robots-Tag "noindex, nofollow" always;
179-
add_header X-XSS-Protection "1; mode=block" always;
180178
access_log off; # Optional: Don't log access to assets
181-
182-
location ~ \.wasm$ {
183-
default_type application/wasm;
184-
}
185179
}
186180

187181
location ~ \.(otf|woff2?)$ {

.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ http {
8383
add_header X-Frame-Options "SAMEORIGIN" always;
8484
add_header X-Permitted-Cross-Domain-Policies "none" always;
8585
add_header X-Robots-Tag "noindex, nofollow" always;
86-
add_header X-XSS-Protection "1; mode=block" always;
8786

8887
# Remove X-Powered-By, which is an information leak
8988
fastcgi_hide_header X-Powered-By;
@@ -162,26 +161,21 @@ http {
162161
fastcgi_pass php-handler;
163162

164163
fastcgi_intercept_errors on;
165-
fastcgi_request_buffering off;
164+
fastcgi_request_buffering on; # Required as PHP-FPM does not support chunked transfer encoding and requires a valid ContentLength header.
166165

167166
fastcgi_max_temp_file_size 0;
168167
}
169168

170169
# Serve static files
171-
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
170+
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
172171
try_files $uri /index.php$request_uri;
173172
add_header Cache-Control "public, max-age=15778463$asset_immutable";
174173
add_header Referrer-Policy "no-referrer" always;
175174
add_header X-Content-Type-Options "nosniff" always;
176175
add_header X-Frame-Options "SAMEORIGIN" always;
177176
add_header X-Permitted-Cross-Domain-Policies "none" always;
178177
add_header X-Robots-Tag "noindex, nofollow" always;
179-
add_header X-XSS-Protection "1; mode=block" always;
180178
access_log off; # Optional: Don't log access to assets
181-
182-
location ~ \.wasm$ {
183-
default_type application/wasm;
184-
}
185179
}
186180

187181
location ~ \.(otf|woff2?)$ {

.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ http {
8383
add_header X-Frame-Options "SAMEORIGIN" always;
8484
add_header X-Permitted-Cross-Domain-Policies "none" always;
8585
add_header X-Robots-Tag "noindex, nofollow" always;
86-
add_header X-XSS-Protection "1; mode=block" always;
8786

8887
# Remove X-Powered-By, which is an information leak
8988
fastcgi_hide_header X-Powered-By;
@@ -162,26 +161,21 @@ http {
162161
fastcgi_pass php-handler;
163162

164163
fastcgi_intercept_errors on;
165-
fastcgi_request_buffering off;
164+
fastcgi_request_buffering on; # Required as PHP-FPM does not support chunked transfer encoding and requires a valid ContentLength header.
166165

167166
fastcgi_max_temp_file_size 0;
168167
}
169168

170169
# Serve static files
171-
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
170+
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
172171
try_files $uri /index.php$request_uri;
173172
add_header Cache-Control "public, max-age=15778463$asset_immutable";
174173
add_header Referrer-Policy "no-referrer" always;
175174
add_header X-Content-Type-Options "nosniff" always;
176175
add_header X-Frame-Options "SAMEORIGIN" always;
177176
add_header X-Permitted-Cross-Domain-Policies "none" always;
178177
add_header X-Robots-Tag "noindex, nofollow" always;
179-
add_header X-XSS-Protection "1; mode=block" always;
180178
access_log off; # Optional: Don't log access to assets
181-
182-
location ~ \.wasm$ {
183-
default_type application/wasm;
184-
}
185179
}
186180

187181
location ~ \.(otf|woff2?)$ {

0 commit comments

Comments
 (0)