我有一个运行反向代理的nginx服务器,用于我的nextcloud(端口82)和letencrypt(端口81),现在我想安装firefly-iii,但无法正常工作。
这是我的.conf文件中的firefly-iii
server {
listen 83;
server_name 127.0.0.1;
# Add headers to serve security related headers
# Use 'proxy_set_header' (not 'add_header') as the headers have to be passed through a proxy.
proxy_set_header Strict-Transport-Security "max-age=15768000; includeSubDomains; always;";
proxy_set_header X-Content-Type-Options "nosniff; always;";
proxy_set_header X-XSS-Protection "1; mode=block; always;";
proxy_set_header X-Robots-Tag none;
proxy_set_header X-Download-Options noopen;
proxy_set_header X-Permitted-Cross-Domain-Policies none;
# Path to the root of your installation
root /var/www/;
location ^~ /firefly-iii {
# set max upload size
client_max_body_size 300M;
fastcgi_buffers 64 4K;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
autoindex on;
sendfile off;
}
include /etc/nginx/default.d/*.conf;
location ~ ^/firefly-iii/\.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
这是从我的主要nginx .conf文件中截取的重定向:
location = / {
# Disable access to the web root, the Nextcloud subdir should be used instead.
#deny all;
# If you want to be able to access the cloud using the webroot only, use the following command inste$
rewrite ^ /nextcloud;
}
#
# Nextcloud
#
location = /favicon.ico {
log_not_found off;
}
location ^~ /nextcloud {
# Set max. size of a request (important for uploads to Nextcloud)
client_max_body_size 10G;
# Besides the timeout values have to be raised in nginx' Nextcloud config, these values have to be r$
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
send_timeout 3600;
proxy_buffering off;
proxy_request_buffering off;
proxy_max_temp_file_size 1024m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:82;
proxy_redirect off;
}
location ^~ /firefly-iii {
client_max_body_size 300M;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
send_timeout 3600;
proxy_buffering off;
proxy_request_buffering off;
proxy_max_temp_file_size 1024m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:83;
proxy_redirect off;
}
加载网址时从 https://example.com/firefly-iii 更改为 https://example.com:83/firefly-iii/ ,并且服务器完全不响应请求(连接超时) )
https://example.com 被故意重写为 https://example.com/nextcloud
nextcloud的配置与firefly-iii的配置之间没有有意义的区别。