mod_http_upload: Add Nginx configuration snippet
Include an example configuration snippet that shows how to tell Nginx to 1) proxy the HTTP PUT requests to mod_http_upload, and to 2) serve the HTTP GET requests directly.
This commit is contained in:
		
							parent
							
								
									dd34fc63c8
								
							
						
					
					
						commit
						9337b3ea39
					
				
							
								
								
									
										25
									
								
								mod_http_upload/examples/nginx-upload.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								mod_http_upload/examples/nginx-upload.conf
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | |||||||
|  | server { | ||||||
|  |     listen *:443 ssl; | ||||||
|  |     server_name upload.example.com; | ||||||
|  |     ssl_certificate /path/to/upload.example.com.crt; | ||||||
|  |     ssl_certificate_key /path/to/upload.example.com.key; | ||||||
|  | 
 | ||||||
|  |     # The `docroot' used by mod_http_upload. | ||||||
|  |     root /home/xmpp/upload; | ||||||
|  | 
 | ||||||
|  |     # Shouldn't be smaller than the `max_size' accepted by mod_http_upload. | ||||||
|  |     client_max_body_size 100m; | ||||||
|  | 
 | ||||||
|  |     location / { | ||||||
|  |         # Pass all requests to ejabberd, except for GET and HEAD requests. | ||||||
|  |         limit_except GET { | ||||||
|  |             proxy_pass http://localhost:5444; | ||||||
|  |         } | ||||||
|  |         proxy_set_header Host $host; | ||||||
|  | 
 | ||||||
|  |         if ($request_method = GET) { | ||||||
|  |             add_header X-Frame-Options DENY; | ||||||
|  |         } | ||||||
|  |         add_header Strict-Transport-Security "max-age=31536000"; | ||||||
|  |     } | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user