User Tools

Site Tools


code:vxmppb:nginx-setup

vXMPPb API Nginx Virtualhost

  • Add a new virtualhost
nano /etc/nginx/sites-available/api.conf
  • Copy/Pasta:
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;
                }
        }
}
  • Activate Virtualhost
sudo ln -s /etc/nginx/sites-available/api.conf /etc/nginx/sites-enabled
  • Reload nginx
service nginx reload
  • Install SSL
certbot --webroot -w /var/www/api -d {URL}

See also, Apache

code/vxmppb/nginx-setup.txt · Last modified: 2023/12/14 17:15 by stephen