diff options
author | VirtualTam <virtualtam@flibidi.net> | 2017-01-04 18:06:14 +0100 |
---|---|---|
committer | VirtualTam <virtualtam+github@flibidi.net> | 2017-01-05 13:24:00 +0100 |
commit | 69173356cd3e1862dbfd5072120e69ec48a11640 (patch) | |
tree | c45180d34be3bdc4505fd91d70886db103bfb9a1 /docker/development | |
parent | 383cbaf2c5a49f5fa54e635ed437d18784830afe (diff) | |
download | Shaarli-69173356cd3e1862dbfd5072120e69ec48a11640.tar.gz Shaarli-69173356cd3e1862dbfd5072120e69ec48a11640.tar.zst Shaarli-69173356cd3e1862dbfd5072120e69ec48a11640.zip |
API+Docker: enable nginx URL rewriting
Closes https://github.com/shaarli/Shaarli/issues/668
Changed:
- let nginx rewrite API URLs
See:
- https://www.slimframework.com/docs/start/web-servers.html
- https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'docker/development')
-rw-r--r-- | docker/development/nginx.conf | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docker/development/nginx.conf b/docker/development/nginx.conf index ac0c6c61..79c45bfe 100644 --- a/docker/development/nginx.conf +++ b/docker/development/nginx.conf | |||
@@ -56,7 +56,16 @@ http { | |||
56 | alias /var/www/shaarli/images/favicon.ico; | 56 | alias /var/www/shaarli/images/favicon.ico; |
57 | } | 57 | } |
58 | 58 | ||
59 | location / { | ||
60 | # Slim - rewrite URLs | ||
61 | try_files $uri /index.php$is_args$args; | ||
62 | } | ||
63 | |||
59 | location ~ (index)\.php$ { | 64 | location ~ (index)\.php$ { |
65 | # Slim - split URL path into (script_filename, path_info) | ||
66 | try_files $uri =404; | ||
67 | fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
68 | |||
60 | # filter and proxy PHP requests to PHP-FPM | 69 | # filter and proxy PHP requests to PHP-FPM |
61 | fastcgi_pass unix:/var/run/php5-fpm.sock; | 70 | fastcgi_pass unix:/var/run/php5-fpm.sock; |
62 | fastcgi_index index.php; | 71 | fastcgi_index index.php; |