mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 02:24:16 +00:00
Improve nginx default response
This commit is contained in:
parent
75174c34d0
commit
dbdfc945ff
@ -184,8 +184,13 @@ http {
|
||||
${this.ssl.cert_file_name ? `ssl_certificate ${this.ssl.cert_file_name};` : ""}
|
||||
${this.ssl.key_file_name ? `ssl_certificate_key ${this.ssl.key_file_name};` : ""}
|
||||
|
||||
# Default route
|
||||
location / {
|
||||
|
||||
|
||||
# Include service-specific configurations
|
||||
include ${normalizedConfigDir}/services.conf;
|
||||
|
||||
# Default route for /
|
||||
location = / {
|
||||
add_header Content-Type application/json;
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
||||
@ -194,8 +199,15 @@ http {
|
||||
return 200 '${mainEndpointJSON}';
|
||||
}
|
||||
|
||||
# Include service-specific configurations
|
||||
include ${normalizedConfigDir}/services.conf;
|
||||
# Catch-all for any other unmatched path
|
||||
location / {
|
||||
add_header Content-Type application/json;
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET,HEAD,PUT,PATCH,POST,DELETE' always;
|
||||
|
||||
return 404 '{"error":"Not found"}';
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
Loading…
x
Reference in New Issue
Block a user