Nginxredirect失败的icingaweb2

我正在尝试使用NginxconfigurationIcingaWeb2,并且遇到了一些问题。 build议的Icinga Nginxconfiguration是:

location ~ ^/icingaweb2/index\.php(.*)$ { # fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/share/icingaweb2/public/index.php; fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2; fastcgi_param REMOTE_USER $remote_user; } location ~ ^/icingaweb2(.+)? { alias /usr/share/icingaweb2/public; index index.php; try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args; } 

这工作正常,但让我们的networking/ icingaweb2 /而我想要它/。 如果我只是删除icingaweb2 /从conf,它工作正常的每个url,但/。

我目前的configuration是:

 server { listen 443 ssl default_server; server_name example.com ssl_certificate cert_path; ssl_certificate_key cert_key; location ~ ^/index\.php(.*)$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/share/icingaweb2/public/index.php; fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2; #fastcgi_param REMOTE_USER $remote_user; } location ~ ^/(.*)? { alias /usr/share/icingaweb2/public; index index.php; try_files $1 $uri $uri/ /index.php$is_args$args; } } 

例如,如果尝试访问https://example.com/dashboard但仅在https://example.com/发生403错误时失败,则此function完全正常。 我也尝试configuration一个特定的location / {}做一个redirecto重写到/仪表板,但仍然得到一个403。

任何想法,我可以尝试下一步?

我修复它在第二个位置重写。

 location ~ ^/(.*)? { alias /usr/share/icingaweb2/public; index index.php; rewrite ^/$ /dashboard; try_files $1 $uri $uri/ /index.php$is_args$args; } 

它不觉得是最好的…但现在一切都按预期工作。