Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. http://server.com/?r=upload/api&uuid=0la4fzVZUMUulOliVcleXY0Kn9nmJGAy&sid=6eo5bhrslh3lggb8kmu8lgk781
  2.  
  3. server {
  4. listen *:80;
  5. server_name server.com;
  6. error_log /var/log/nginx/error.log error;
  7. access_log /var/log/nginx/access.log;
  8. # Define root
  9. root /path/to/root;
  10. set $fs_webroot "/path/to/root";
  11. index index.php;
  12. # robots.txt
  13. location = /robots.txt {
  14. alias $fs_webroot/deny.robots.txt;
  15. }
  16.  
  17. # Upload form should be submitted to this location
  18. location ~ "^/?r=upload/api(.*)" {
  19. client_max_body_size 500M;
  20.  
  21. # Pass altered request body to this location
  22. upload_pass @php_fpm;
  23.  
  24. # Resumable upload
  25. upload_resumable on;
  26. upload_state_store /upload_path/states;
  27. # Store files to this directory
  28. upload_store /upload_path;
  29.  
  30. # Set specified fields in request body
  31. upload_set_form_field "${upload_field_name}_name" $upload_file_name;
  32. upload_set_form_field "${upload_field_name}_path" $upload_tmp_path;
  33. upload_pass_args on;
  34. # Cleanup
  35. upload_cleanup 400 401 403 404 499 500-505;
  36.  
  37. add_header 'Access-Control-Allow-Origin' '*';
  38.  
  39. }
  40.  
  41. # Domain root
  42. location / {
  43. try_files $uri $uri/ /index.php?$query_string;
  44. }
  45.  
  46. location ~.php$ {
  47. fastcgi_pass unix:/path_to_sock.sock;
  48. fastcgi_index index.php;
  49. fastcgi_param SCRIPT_FILENAME $fs_webroot/$fastcgi_script_name;
  50. include fastcgi_params;
  51. fastcgi_param REQUEST_METHOD $request_method;
  52. fastcgi_param PATH_INFO $fastcgi_script_name;
  53.  
  54. add_header Pragma no-cache;
  55. add_header Cache-Control no-cache,must-revalidate;
  56. add_header Access-Control-Allow-Origin *;
  57. }
  58.  
  59. location @php_fpm {
  60. fastcgi_pass unix:/path_to_sock.sock;
  61. fastcgi_index index.php;
  62. fastcgi_param SCRIPT_FILENAME $fs_webroot/$fastcgi_script_name;
  63. include fastcgi_params;
  64. fastcgi_param REQUEST_METHOD $request_method;
  65. fastcgi_param PATH_INFO $fastcgi_script_name;
  66. add_header Pragma no-cache;
  67. add_header Cache-Control no-cache,must-revalidate;
  68. add_header Access-Control-Allow-Origin *;
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement