How to manage multiple sites on the same server with Nginx?Blank Page: wordpress on nginx+php-fpmLaravel 4.1...

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Misplaced tyre lever - alternatives?

Graphing random points on the XY-plane

Plagiarism of code by other PhD student

What is better: yes / no radio, or simple checkbox?

Borrowing Characters

Is there a legal poaching?

Why can't we make a perpetual motion machine by using a magnet to pull up a piece of metal, then letting it fall back down?

How do you say "powers of ten"?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

What Does the Heart In Gyms Mean?

How can I create a Table like this in Latex?

Real life puzzle: Unknown alphabet or shorthand

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

When was drinking water recognized as crucial in marathon running?

Can we carry rice to Japan?

Sometimes a banana is just a banana

Why is it "take a leak?"

In Adventurer's League, is it possible to keep the Ring of Winter if you manage to acquire it in the Tomb of Annihilation adventure?

Can throughput exceed the bandwidth of a network

If nine coins are tossed, what is the probability that the number of heads is even?

Difference between 'stomach' and 'uterus'

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Is it possible to make a clamp function shorter than a ternary in JS?



How to manage multiple sites on the same server with Nginx?


Blank Page: wordpress on nginx+php-fpmLaravel 4.1 on nginx routes error 404Nginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questionsCodeIgniter nginx rewrite rules for i8ln URL'sHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?NGINX virtual host config for Magento2 in a subfolder













0















I have 2 sites on the same Nginx server.



My first site https://www.example.com all the following addresses must redirect to this domain:



xx.xx.xx.xxx



http://example.com



http://www.example.com



https://example.com



My second site https://analytics.example.com the following address must redirect to this domain:



http://analytics.example.com



If I disable the second site, the first site works fine.



There is a conflict when I activate multiple sites with Nginx. How can I fix that ?



With the settings below :



ubuntu@www-example-com ~ $ sudo nginx -t
nginx: [emerg] duplicate listen options for [::]:80 in /etc/nginx/sites-enabled/www-s1biose-com:3
nginx: configuration file /etc/nginx/nginx.conf test failed


www.example.com



server {
listen 80 default_server;
listen [::]:80 ipv6only=on default_server;
server_name example.com www.example.com;

location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
}

location / {
return 301 https://www.example.com$request_uri;
}
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2 ipv6only=on;
server_name www.example.com;
root /var/www/www-example-com/web;
index index.php;

ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

brotli on;
brotli_comp_level 6;
brotli_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

expires 1209600s;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ~* .(txt|log)$ {
deny all;
}

location ~ ..*/.*.php$ {
return 403;
}

location ~ ^/sites/.*/private/ {
return 403;
}

location ~ ^/sites/[^/]+/files/.*.php$ {
deny all;
}

location ~* ^/.well-known/ {
allow all;
}

location ~ (^|/). {
return 403;
}

location / {
try_files $uri /index.php?$query_string;
}

location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}

location ~ /vendor/.*.php$ {
deny all;
return 404;
}

location ~ '.php$|^/update.php' {
expires off;
fastcgi_split_path_info ^(.+?.php)(|/.*)$;
include fastcgi_params;
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}

location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}

location ~ ^(/[a-z-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}

location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;

ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

location / {
return 301 https://www.example.com$request_uri;
}
}


analytics.example.com



server {
listen 80;
listen [::]:80 ipv6only=on;
server_name analytics.example.com;

location / {
return 301 https://analytics.example.com$request_uri;
}
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2 ipv6only=on;
server_name analytics.example.com;
root /var/www/analytics-example-com/web;
index report.html;

auth_basic "Protected";
auth_basic_user_file /var/www/analytics-example-com/web/.htpasswd;

ssl_certificate /etc/letsencrypt/live/analytics.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/analytics.example.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}








share







New contributor




ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have 2 sites on the same Nginx server.



    My first site https://www.example.com all the following addresses must redirect to this domain:



    xx.xx.xx.xxx



    http://example.com



    http://www.example.com



    https://example.com



    My second site https://analytics.example.com the following address must redirect to this domain:



    http://analytics.example.com



    If I disable the second site, the first site works fine.



    There is a conflict when I activate multiple sites with Nginx. How can I fix that ?



    With the settings below :



    ubuntu@www-example-com ~ $ sudo nginx -t
    nginx: [emerg] duplicate listen options for [::]:80 in /etc/nginx/sites-enabled/www-s1biose-com:3
    nginx: configuration file /etc/nginx/nginx.conf test failed


    www.example.com



    server {
    listen 80 default_server;
    listen [::]:80 ipv6only=on default_server;
    server_name example.com www.example.com;

    location ^~ /.well-known/acme-challenge/ {
    default_type "text/plain";
    root /var/www/letsencrypt;
    }

    location / {
    return 301 https://www.example.com$request_uri;
    }
    }

    server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2 ipv6only=on;
    server_name www.example.com;
    root /var/www/www-example-com/web;
    index index.php;

    ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "no-referrer-when-downgrade" always;
    add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

    gzip on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

    brotli on;
    brotli_comp_level 6;
    brotli_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

    expires 1209600s;

    location = /favicon.ico {
    log_not_found off;
    access_log off;
    }

    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }

    location ~* .(txt|log)$ {
    deny all;
    }

    location ~ ..*/.*.php$ {
    return 403;
    }

    location ~ ^/sites/.*/private/ {
    return 403;
    }

    location ~ ^/sites/[^/]+/files/.*.php$ {
    deny all;
    }

    location ~* ^/.well-known/ {
    allow all;
    }

    location ~ (^|/). {
    return 403;
    }

    location / {
    try_files $uri /index.php?$query_string;
    }

    location @rewrite {
    rewrite ^/(.*)$ /index.php?q=$1;
    }

    location ~ /vendor/.*.php$ {
    deny all;
    return 404;
    }

    location ~ '.php$|^/update.php' {
    expires off;
    fastcgi_split_path_info ^(.+?.php)(|/.*)$;
    include fastcgi_params;
    fastcgi_param HTTP_PROXY "";
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param QUERY_STRING $query_string;
    fastcgi_intercept_errors on;
    fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }

    location ~ ^/sites/.*/files/styles/ {
    try_files $uri @rewrite;
    }

    location ~ ^(/[a-z-]+)?/system/files/ {
    try_files $uri /index.php?$query_string;
    }

    location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    try_files $uri @rewrite;
    expires max;
    log_not_found off;
    }
    }

    server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.com;

    ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "no-referrer-when-downgrade" always;
    add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

    location / {
    return 301 https://www.example.com$request_uri;
    }
    }


    analytics.example.com



    server {
    listen 80;
    listen [::]:80 ipv6only=on;
    server_name analytics.example.com;

    location / {
    return 301 https://analytics.example.com$request_uri;
    }
    }

    server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2 ipv6only=on;
    server_name analytics.example.com;
    root /var/www/analytics-example-com/web;
    index report.html;

    auth_basic "Protected";
    auth_basic_user_file /var/www/analytics-example-com/web/.htpasswd;

    ssl_certificate /etc/letsencrypt/live/analytics.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/analytics.example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
    }








    share







    New contributor




    ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have 2 sites on the same Nginx server.



      My first site https://www.example.com all the following addresses must redirect to this domain:



      xx.xx.xx.xxx



      http://example.com



      http://www.example.com



      https://example.com



      My second site https://analytics.example.com the following address must redirect to this domain:



      http://analytics.example.com



      If I disable the second site, the first site works fine.



      There is a conflict when I activate multiple sites with Nginx. How can I fix that ?



      With the settings below :



      ubuntu@www-example-com ~ $ sudo nginx -t
      nginx: [emerg] duplicate listen options for [::]:80 in /etc/nginx/sites-enabled/www-s1biose-com:3
      nginx: configuration file /etc/nginx/nginx.conf test failed


      www.example.com



      server {
      listen 80 default_server;
      listen [::]:80 ipv6only=on default_server;
      server_name example.com www.example.com;

      location ^~ /.well-known/acme-challenge/ {
      default_type "text/plain";
      root /var/www/letsencrypt;
      }

      location / {
      return 301 https://www.example.com$request_uri;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2 ipv6only=on;
      server_name www.example.com;
      root /var/www/www-example-com/web;
      index index.php;

      ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

      add_header X-Frame-Options "SAMEORIGIN" always;
      add_header X-XSS-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      add_header Referrer-Policy "no-referrer-when-downgrade" always;
      add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

      gzip on;
      gzip_vary on;
      gzip_proxied any;
      gzip_comp_level 6;
      gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

      brotli on;
      brotli_comp_level 6;
      brotli_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

      expires 1209600s;

      location = /favicon.ico {
      log_not_found off;
      access_log off;
      }

      location = /robots.txt {
      allow all;
      log_not_found off;
      access_log off;
      }

      location ~* .(txt|log)$ {
      deny all;
      }

      location ~ ..*/.*.php$ {
      return 403;
      }

      location ~ ^/sites/.*/private/ {
      return 403;
      }

      location ~ ^/sites/[^/]+/files/.*.php$ {
      deny all;
      }

      location ~* ^/.well-known/ {
      allow all;
      }

      location ~ (^|/). {
      return 403;
      }

      location / {
      try_files $uri /index.php?$query_string;
      }

      location @rewrite {
      rewrite ^/(.*)$ /index.php?q=$1;
      }

      location ~ /vendor/.*.php$ {
      deny all;
      return 404;
      }

      location ~ '.php$|^/update.php' {
      expires off;
      fastcgi_split_path_info ^(.+?.php)(|/.*)$;
      include fastcgi_params;
      fastcgi_param HTTP_PROXY "";
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param PATH_INFO $fastcgi_path_info;
      fastcgi_param QUERY_STRING $query_string;
      fastcgi_intercept_errors on;
      fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
      }

      location ~ ^/sites/.*/files/styles/ {
      try_files $uri @rewrite;
      }

      location ~ ^(/[a-z-]+)?/system/files/ {
      try_files $uri /index.php?$query_string;
      }

      location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
      try_files $uri @rewrite;
      expires max;
      log_not_found off;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2;
      server_name example.com;

      ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

      add_header X-Frame-Options "SAMEORIGIN" always;
      add_header X-XSS-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      add_header Referrer-Policy "no-referrer-when-downgrade" always;
      add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

      location / {
      return 301 https://www.example.com$request_uri;
      }
      }


      analytics.example.com



      server {
      listen 80;
      listen [::]:80 ipv6only=on;
      server_name analytics.example.com;

      location / {
      return 301 https://analytics.example.com$request_uri;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2 ipv6only=on;
      server_name analytics.example.com;
      root /var/www/analytics-example-com/web;
      index report.html;

      auth_basic "Protected";
      auth_basic_user_file /var/www/analytics-example-com/web/.htpasswd;

      ssl_certificate /etc/letsencrypt/live/analytics.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/analytics.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
      }








      share







      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have 2 sites on the same Nginx server.



      My first site https://www.example.com all the following addresses must redirect to this domain:



      xx.xx.xx.xxx



      http://example.com



      http://www.example.com



      https://example.com



      My second site https://analytics.example.com the following address must redirect to this domain:



      http://analytics.example.com



      If I disable the second site, the first site works fine.



      There is a conflict when I activate multiple sites with Nginx. How can I fix that ?



      With the settings below :



      ubuntu@www-example-com ~ $ sudo nginx -t
      nginx: [emerg] duplicate listen options for [::]:80 in /etc/nginx/sites-enabled/www-s1biose-com:3
      nginx: configuration file /etc/nginx/nginx.conf test failed


      www.example.com



      server {
      listen 80 default_server;
      listen [::]:80 ipv6only=on default_server;
      server_name example.com www.example.com;

      location ^~ /.well-known/acme-challenge/ {
      default_type "text/plain";
      root /var/www/letsencrypt;
      }

      location / {
      return 301 https://www.example.com$request_uri;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2 ipv6only=on;
      server_name www.example.com;
      root /var/www/www-example-com/web;
      index index.php;

      ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

      add_header X-Frame-Options "SAMEORIGIN" always;
      add_header X-XSS-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      add_header Referrer-Policy "no-referrer-when-downgrade" always;
      add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

      gzip on;
      gzip_vary on;
      gzip_proxied any;
      gzip_comp_level 6;
      gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

      brotli on;
      brotli_comp_level 6;
      brotli_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

      expires 1209600s;

      location = /favicon.ico {
      log_not_found off;
      access_log off;
      }

      location = /robots.txt {
      allow all;
      log_not_found off;
      access_log off;
      }

      location ~* .(txt|log)$ {
      deny all;
      }

      location ~ ..*/.*.php$ {
      return 403;
      }

      location ~ ^/sites/.*/private/ {
      return 403;
      }

      location ~ ^/sites/[^/]+/files/.*.php$ {
      deny all;
      }

      location ~* ^/.well-known/ {
      allow all;
      }

      location ~ (^|/). {
      return 403;
      }

      location / {
      try_files $uri /index.php?$query_string;
      }

      location @rewrite {
      rewrite ^/(.*)$ /index.php?q=$1;
      }

      location ~ /vendor/.*.php$ {
      deny all;
      return 404;
      }

      location ~ '.php$|^/update.php' {
      expires off;
      fastcgi_split_path_info ^(.+?.php)(|/.*)$;
      include fastcgi_params;
      fastcgi_param HTTP_PROXY "";
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param PATH_INFO $fastcgi_path_info;
      fastcgi_param QUERY_STRING $query_string;
      fastcgi_intercept_errors on;
      fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
      }

      location ~ ^/sites/.*/files/styles/ {
      try_files $uri @rewrite;
      }

      location ~ ^(/[a-z-]+)?/system/files/ {
      try_files $uri /index.php?$query_string;
      }

      location ~* .(js|css|png|jpg|jpeg|gif|ico|svg)$ {
      try_files $uri @rewrite;
      expires max;
      log_not_found off;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2;
      server_name example.com;

      ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

      add_header X-Frame-Options "SAMEORIGIN" always;
      add_header X-XSS-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      add_header Referrer-Policy "no-referrer-when-downgrade" always;
      add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

      location / {
      return 301 https://www.example.com$request_uri;
      }
      }


      analytics.example.com



      server {
      listen 80;
      listen [::]:80 ipv6only=on;
      server_name analytics.example.com;

      location / {
      return 301 https://analytics.example.com$request_uri;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2 ipv6only=on;
      server_name analytics.example.com;
      root /var/www/analytics-example-com/web;
      index report.html;

      auth_basic "Protected";
      auth_basic_user_file /var/www/analytics-example-com/web/.htpasswd;

      ssl_certificate /etc/letsencrypt/live/analytics.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/analytics.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
      }






      nginx virtualhost domain https subdomain





      share







      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 7 mins ago









      ML19ML19

      103




      103




      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          ML19 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956936%2fhow-to-manage-multiple-sites-on-the-same-server-with-nginx%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          ML19 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          ML19 is a new contributor. Be nice, and check out our Code of Conduct.













          ML19 is a new contributor. Be nice, and check out our Code of Conduct.












          ML19 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956936%2fhow-to-manage-multiple-sites-on-the-same-server-with-nginx%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...