From ba17ce8616efefa10f318e56580a929998cb5127 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Mar 2025 20:46:50 +0200 Subject: [PATCH] fix(docs): numbering in Nginx --- docs/User Guide/!!!meta.json | 8 +- .../2. Reverse proxy/Nginx.md | 90 +++++++++---------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json index 38b67a041..09da4fd36 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -9,7 +9,7 @@ "pOsGYCXsbNQG" ], "title": "User Guide", - "notePosition": 100, + "notePosition": 80, "prefix": null, "isExpanded": false, "type": "text", @@ -2009,21 +2009,21 @@ "name": "internalLink", "value": "IakOLONlIfGI", "isInheritable": false, - "position": 80 + "position": 70 }, { "type": "relation", "name": "internalLink", "value": "ODY7qQn5m2FT", "isInheritable": false, - "position": 90 + "position": 80 }, { "type": "relation", "name": "internalLink", "value": "CoFPLs3dRlXc", "isInheritable": false, - "position": 100 + "position": 90 }, { "type": "label", diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md index a8dbc667e..a5423117b 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx.md @@ -2,50 +2,50 @@ Configure Nginx proxy and HTTPS. The operating system here is Ubuntu 18.04. 1. Download Nginx and remove Apache2 - -```sh -sudo apt-get install nginx -sudo apt-get remove apache2 -``` - -1. Create configure file - -```sh -cd /etc/nginx/conf.d -vim default.conf -``` - -1. Fill the file with the context shown below, part of the setting show be changed. Then you can enjoy your web with HTTPS forced and proxy. - -```conf -# This part is for proxy and HTTPS configure -server { - listen 443 ssl; - server_name trilium.example.net; #change trilium.example.net to your domain without HTTPS or HTTP. - ssl_certificate /etc/ssl/note/example.crt; #change /etc/ssl/note/example.crt to your path of crt file. - ssl_certificate_key /etc/ssl/note/example.net.key; #change /etc/ssl/note/example.net.key to your path of key file. - ssl_session_cache builtin:1000 shared:SSL:10m; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; - ssl_prefer_server_ciphers on; - access_log /var/log/nginx/access.log; #check the path of access.log, if it doesn't fit your file, change it - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_pass http://127.0.0.1:8080; # change it to a different port if non-default is used - proxy_read_timeout 90; - proxy_redirect http://127.0.0.1:8080 https://trilium.example.net; # change them based on your IP, port and domain + ``` + sudo apt-get install nginx + sudo apt-get remove apache2 + ``` + +2. Create configure file + + ``` + cd /etc/nginx/conf.d + vim default.conf + ``` + +3. Fill the file with the context shown below, part of the setting show be changed. Then you can enjoy your web with HTTPS forced and proxy. + + ``` + # This part is for proxy and HTTPS configure + server { + listen 443 ssl; + server_name trilium.example.net; #change trilium.example.net to your domain without HTTPS or HTTP. + ssl_certificate /etc/ssl/note/example.crt; #change /etc/ssl/note/example.crt to your path of crt file. + ssl_certificate_key /etc/ssl/note/example.net.key; #change /etc/ssl/note/example.net.key to your path of key file. + ssl_session_cache builtin:1000 shared:SSL:10m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; + ssl_prefer_server_ciphers on; + access_log /var/log/nginx/access.log; #check the path of access.log, if it doesn't fit your file, change it + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_pass http://127.0.0.1:8080; # change it to a different port if non-default is used + proxy_read_timeout 90; + proxy_redirect http://127.0.0.1:8080 https://trilium.example.net; # change them based on your IP, port and domain + } } -} -# This part is for HTTPS forced -server { - listen 80; - server_name trilium.example.net; # change to your domain - return 301 https://$server_name$request_uri; -} -``` \ No newline at end of file + # This part is for HTTPS forced + server { + listen 80; + server_name trilium.example.net; # change to your domain + return 301 https://$server_name$request_uri; + } + ``` \ No newline at end of file