nano /etc/nginx/sites-available/api.conf
user nobody nobody;
worker_processes 1;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
#
# This should be changed to whatever you config to real server.
#
root /var/www/api;
keepalive_timeout 5;
keepalive_requests 100;
log_format default '$remote_addr - $remote_user $time_local "$request" $status $body_bytes_sent';
log_format format_0 'combined';
access_log ${APACHE_LOG_DIR}/api-access.log format_0;
error_log ${APACHE_LOG_DIR}/api-error.log warn;
server {
listen 80;
server_name {URL};
allow all;
location "/var/www/api" {
satisfy all;
allow all;
}
}
}
sudo ln -s /etc/nginx/sites-available/api.conf /etc/nginx/sites-enabled
service nginx reload
certbot --webroot -w /var/www/api -d {URL}
See also, Apache