NGINX Configuration

This tutorial will suport the configuration through NGINX, after completing run&deploy tutorials (basic or advanced)

If you have a standard ATON deployment running on port 8080, a basic configuration listening on port 80 (http) is:

server {
        listen 80 default_server;
        #server_name <your-domain>;

        location / {
                proxy_pass http://127.0.0.1:8080;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
}

Thus at this point, you should be able to reach this ATON instance via http://<IP-address>.

If you have your own domain or sub-domain pointing to this public IP, you can uncomment server_name directive with your domain or sub-domain.

Adding SSL

In order to provide access to some advanced features like WebXR, device orientation, camera/microphone access, and others – you’ll need a secure connection (https) by adding SSL certificates and listening of course on port 443:

server {
        listen 443 ssl;
        server_name <your-domain>;

        location / {
                proxy_pass http://127.0.0.1:8080;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

        ssl_certificate <your-path-to-fullchain.pem>
        ssl_certificate_key <your-path-to-key.pem>
        ...
}

If you are using certbot, some of these SSL fields are automatically set by the command.