Skip to content

Instantly share code, notes, and snippets.

@VirtuBox
Last active October 25, 2022 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VirtuBox/74b9de8f45da6732122818dca909c1e4 to your computer and use it in GitHub Desktop.
Save VirtuBox/74b9de8f45da6732122818dca909c1e4 to your computer and use it in GitHub Desktop.
Host a site available on hostname:port or localhost:port
# file /var/www/site.tld/conf/nginx/ssl.conf
# Here Nginx list on port 1443 instead of 443
listen 1443 ssl http2;
listen [::]:1443 ssl http2;
ssl_certificate /etc/letsencrypt/live/site.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.tld/key.pem;
ssl_trusted_certificate /etc/letsencrypt/live/site.tld/ca.pem;
# file /etc/nginx/sites-available/site.tld
# the directive server_name _; allow to use any host/domain to access to the site
server {
server_name _;
access_log /var/log/nginx/site.tld.access.log rt_cache;
error_log /var/log/nginx/site.tld.error.log;
root /var/www/site.tld/htdocs;
index index.php index.html index.htm;
include common/wpfc-php80.conf;
include common/wpcommon-php80.conf;
include common/locations-wo.conf;
include /var/www/site.tld/conf/nginx/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment