Changing Nginx Ports

  1. Open the IBM Aspera Shares on Demand Nginx config file found at /opt/aspera/shares/etc/nginx/nginx.conf.
  2. Update the HTTP and HTTPS server blocks with your desired ports.
    These are the default settings for the two server blocks:
    server {
        listen 80 deferred;
        return 301 https://$host$request_uri;
    }
             
    server {
        listen 443 deferred;
        ssl on;
    }
    Update the values of the listen and rewrite directives with the desired ports (for example, 9080 and 9443).
    server {
        listen 9080 deferred;
        return 301 https://$host:9443$request_uri;
    }
                        
    server {
        listen 9443 deferred;
        ssl on;
    }
  3. Update the passenger_pre_start directive located at: /opt/aspera/shares/etc/nginx/conf.d/shares-pre-start.conf.
    The default value for passenger_pre_start is the following:
    passenger_pre_start https://example.com:443/;
    Update the passenger_pre_start with your desired port. For example:
    passenger_pre_start https://example.com:9443/; 
    Note: Prior to Shares on Demand 1.8, the passenger_pre_start directive is in the main nginx.conf file.
  4. Tell Nginx to reload its config file.
    /opt/aspera/shares/sbin/nginx -s reload