Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://server.com/?r=upload/api&uuid=0la4fzVZUMUulOliVcleXY0Kn9nmJGAy&sid=6eo5bhrslh3lggb8kmu8lgk781
- server {
- listen *:80;
- server_name server.com;
- error_log /var/log/nginx/error.log error;
- access_log /var/log/nginx/access.log;
- # Define root
- root /path/to/root;
- set $fs_webroot "/path/to/root";
- index index.php;
- # robots.txt
- location = /robots.txt {
- alias $fs_webroot/deny.robots.txt;
- }
- # Upload form should be submitted to this location
- location ~ "^/?r=upload/api(.*)" {
- client_max_body_size 500M;
- # Pass altered request body to this location
- upload_pass @php_fpm;
- # Resumable upload
- upload_resumable on;
- upload_state_store /upload_path/states;
- # Store files to this directory
- upload_store /upload_path;
- # Set specified fields in request body
- upload_set_form_field "${upload_field_name}_name" $upload_file_name;
- upload_set_form_field "${upload_field_name}_path" $upload_tmp_path;
- upload_pass_args on;
- # Cleanup
- upload_cleanup 400 401 403 404 499 500-505;
- add_header 'Access-Control-Allow-Origin' '*';
- }
- # Domain root
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location ~.php$ {
- fastcgi_pass unix:/path_to_sock.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $fs_webroot/$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param PATH_INFO $fastcgi_script_name;
- add_header Pragma no-cache;
- add_header Cache-Control no-cache,must-revalidate;
- add_header Access-Control-Allow-Origin *;
- }
- location @php_fpm {
- fastcgi_pass unix:/path_to_sock.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $fs_webroot/$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param PATH_INFO $fastcgi_script_name;
- add_header Pragma no-cache;
- add_header Cache-Control no-cache,must-revalidate;
- add_header Access-Control-Allow-Origin *;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement