Leonid Nikitin
9bfd3fef1a
Added Swagger as a new service in the docker-compose file for generating the API documentation. The new API documentation is provided via an OpenAPI file located at `public/swagger.json`. Changes in routing were done to handle /api-docs requests and redirect them to the running Swagger UI instance. This will make API easier to understand and debug.
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
server_name localhost;
|
|
|
|
client_max_body_size 1024M;
|
|
|
|
root /var/www/html/public;
|
|
|
|
location / {
|
|
location /api-docs {
|
|
proxy_pass http://swagger:8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
location / {
|
|
# try to serve file directly, fallback to index.php
|
|
try_files $uri /index.php$is_args$args;
|
|
}
|
|
}
|
|
|
|
location ~ ^/index\.php(/|$) {
|
|
fastcgi_pass app:9000;
|
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
|
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
|
# Prevents URIs that include the front controller. This will 404:
|
|
# http://domain.tld/index.php/some-path
|
|
# Remove the internal directive to allow URIs like this
|
|
internal;
|
|
}
|
|
|
|
# return 404 for all other php files not matching the front controller
|
|
# this prevents access to other php files you don't want to be accessible.
|
|
location ~ \.php$ {
|
|
return 404;
|
|
}
|
|
|
|
error_log /var/log/angie/project_error.log;
|
|
access_log /var/log/angie/project_access.log;
|
|
}
|