☑️HTTP/HTTPS
In most organizations HTTP/HTTPS traffic is most commonly allowed through firewall thus it is preferred to transfer files over HTTP/HTTPS. We saw how to setup uploadserver but now lets see how to setup and use other secure web servers like Nginx and Apache. Here are the steps of configuring the web server:
Make a directory to handle uploaded files:
sudo mkdir -p /var/www/uploads/SecretUploadDirectorychange the owner to www-data
sudo chown -R www-data:www-data /var/www/uploads/SecretUploadDirectoryCreate the Nginx configuration file by creating the file /etc/nginx/sites-available/upload.conf with the contents:
server {
listen 9001;
location /SecretUploadDirectory/ {
root /var/www/uploads;
dav_methods PUT;
}
}Symlink our Site to the sites-enabled Directory:
sudo ln -s /etc/nginx/sites-available/upload.conf /etc/nginx/sites-enabled/Start Nginx:
sudo systemctl restart nginx.serviceNow to verify errors:
By default Nginx will use port 80 but sometimes this port might already be in use. To check we can do:
We have to remove the default Nginx config:
Now we can test our uploading using cURL and wget:
Last updated