Project

General

Profile

Defect #21682

Updated by Toshi MARUYAMA over 8 years ago

I set up Redmine with nginx as a reverse proxy according to this HowTo: [[HowTo_configure_Nginx_to_run_Redmine]] http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Nginx_to_run_Redmine 

 For the most part it seems to work normally. Then I tried to delete a project which did not work. 
 The HowTo's nginx configuration rewrites some "sensitive" paths to https and then rewrites back to http for "non-sensitive" paths except some paths that would be broken otherwise: 
 <pre> 
 # Examples of URLs we don't want to rewrite (otherwise 404 errors occur): 
 # /projects/PROJECTNAME/archive?status= 
 # /projects/copy/PROJECTNAME 
 # /projects/PROJECTNAME/destroy 

 # This should exclude those (tested here: http://www.regextester.com/ ) 
 if ($uri !~* "^/projects/.*(copy|destroy|archive)") { 
     rewrite ^/projects(.*) http://your.domain.here$request_uri permanent; 
 } 
 </pre> 

 As far as I can see these excluded paths are outdated. This does for example break the DELETE request upon project deletion. 

 I worked around this by commenting out all the rewriting stuff and just defaulting to https with: 
 <pre> 
 server { 
	 listen 80; 
	 return 301 https://$server_name$request_uri; 
 } 
 </pre> 
 _(In my opinion this is should be done anyways because data of non-public projects musn't be sent over http...)_ 

 The regex has to be updated to match the new path structure.

Back