Skip to content

Commit

Permalink
Update examples nginx configuration (#2307)
Browse files Browse the repository at this point in the history
* Update config based on the official docs

Signed-off-by: Kaloyan Nikolov <[email protected]>

* Update all example nginx configs according to the documentation

Signed-off-by: Kaloyan Nikolov <[email protected]>

---------

Signed-off-by: Kaloyan Nikolov <[email protected]>
  • Loading branch information
tzerber authored Oct 8, 2024
1 parent 5a242f6 commit 8c777a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ http {
default_type application/octet-stream;
types {
text/javascript mjs;
application/wasm wasm;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
Expand Down Expand Up @@ -143,7 +144,7 @@ http {
# to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
# Required for legacy support
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

fastcgi_split_path_info ^(.+?\.php)(/.*)$;
set $path_info $fastcgi_path_info;
Expand All @@ -166,7 +167,7 @@ http {
}

# Serve static files
location ~ \.(?:css|svg|js|mjs|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
Expand Down
5 changes: 3 additions & 2 deletions .examples/docker-compose/insecure/postgres/fpm/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ http {
default_type application/octet-stream;
types {
text/javascript mjs;
application/wasm wasm;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
Expand Down Expand Up @@ -143,7 +144,7 @@ http {
# to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
# Required for legacy support
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

fastcgi_split_path_info ^(.+?\.php)(/.*)$;
set $path_info $fastcgi_path_info;
Expand All @@ -166,7 +167,7 @@ http {
}

# Serve static files
location ~ \.(?:css|svg|js|mjs|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ http {
default_type application/octet-stream;
types {
text/javascript mjs;
application/wasm wasm;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
Expand Down Expand Up @@ -143,7 +144,7 @@ http {
# to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
# Required for legacy support
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

fastcgi_split_path_info ^(.+?\.php)(/.*)$;
set $path_info $fastcgi_path_info;
Expand All @@ -166,7 +167,7 @@ http {
}

# Serve static files
location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ http {
default_type application/octet-stream;
types {
text/javascript mjs;
application/wasm wasm;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
Expand Down Expand Up @@ -143,7 +144,7 @@ http {
# to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
# Required for legacy support
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

fastcgi_split_path_info ^(.+?\.php)(/.*)$;
set $path_info $fastcgi_path_info;
Expand All @@ -166,7 +167,7 @@ http {
}

# Serve static files
location ~ \.(?:css|svg|js|mjs|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
Expand Down

0 comments on commit 8c777a4

Please sign in to comment.