User Tools

Site Tools



vXMPPb API Nginx Virtualhost

  1. Add a new virtualhost
nano /etc/nginx/sites-available/api.conf
  1. Copy/Pasta:

user  nobody nobody;
worker_processes  1;
pid  logs/;

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;
  1. Activate Virtualhost

sudo ln -s /etc/nginx/sites-available/api.conf /etc/nginx/sites-enabled
  1. Reload nginx

service nginx reload
  1. Install SSL

certbot --webroot -w /var/www/api -d {URL}

See also, Apache

code/vxmppb/nginx-setup.txt · Last modified: 2022/04/10 12:16 by stephen