Defect #21682

Updated by Toshi MARUYAMA about 8 years ago

I set up Redmine with nginx as a reverse proxy according to this HowTo: [[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: 
 # 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: ) 
 if ($uri !~* "^/projects/.*(copy|destroy|archive)") { 
     rewrite ^/projects(.*)$request_uri permanent; 

 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: 
 server { 
	 listen 80; 
	 return 301 https://$server_name$request_uri; 
 _(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.