How to open https on nginx server under Ubuntu

Tencent Cloud's [Guide] (https://cloud.tencent.com/document/product/400/35244?from=10680) is based on CentOs and does not apply to Ubuntu systems.

The following is a correction to the part of the above guidance article that does not apply to Ubuntu.

nginx configuration folder: /etc/nginx/
nginx executable file: /usr/sbin/nginx
Add https site: modify /etc/nginx/sites-enabled/* *site configuration file

Modified content:

server {
 listen 443;
 server_name www.domain.com; #Fill in the domain name of the binding certificate
 ssl on;
 root /var/www/www.domain.com; #The homepage path of the website. This path is for reference only, please follow the actual directory for details.
 index index.html index.htm;   
 ssl_certificate  /usr/local/nginx/conf/1_www.domain.com_bundle.crt; #Certificate file path+name
 ssl_certificate_key /usr/local/nginx/conf/2_www.domain.com.key; #Private key file path+name
 ssl_session_timeout 5m;
 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 ssl_prefer_server_ciphers on;
 location / {
  index index.html index.htm;}}
server {
 listen 80;
 server_name www.domain.com; #Fill in the domain name of the binding certificate
 rewrite ^(.*)$ https://$host$1 permanent; #Convert http domain name request to https
}

Recommended Posts

How to open https on nginx server under Ubuntu
How to install Nginx on Ubuntu 20.04
How to secure Nginx on Ubuntu 14.04
How to install Nginx on Ubuntu 20.04
How to install Nginx on Ubuntu 16.04
How to install Bacula Server on Ubuntu 14.04
How to use Samba server on Ubuntu 16.04
How to install Zabbix on Ubuntu 16.04 Server
How to install Squid proxy server on Ubuntu 18.04
How to set up Shiny Server on Ubuntu 14.04
How to set static IP on Ubuntu 18.04 Server
How to quickly build Nginx server under CentOS
How to set static IP on Ubuntu 18.04 Server
How to run the parsing server on Ubuntu 14.04
How to add logging module to Nginx on Ubuntu 16.04
How to set up a DNS server on Ubuntu 18.04
How to add the gzip module to Nginx on Ubuntu 14.04
How to install Ruby on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to compile ijkplayer-android under ubuntu
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Nginx on CentOS 8
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to deploy Django on Ubuntu 14.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to install MariaDB on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to uninstall software on Ubuntu
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Postman on Ubuntu 18.04
How to install Go 1.6 on Ubuntu 16.04
How to install Go on Ubuntu 18.04
How to install MySQL on Ubuntu 14.04