【3】Trilium 博客配置代理

shmaur
2024-08-30
-
-

博客主题导入成功后,配置代理,我的配置如下

 

server {
  listen 80;
  server_name www.shmaur.com shmaur.com;
  client_max_body_size 500m;
  gzip on;
  gzip_min_length 1k;
  gzip_comp_level 9;
  gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  gzip_vary on;
  gzip_disable "MSIE [1-6]\.";
  if ( $host != 'www.shmaur.com' ) {
		rewrite ^(.*)$ https://www.shmaur.com permanent;
	}
   location =/ {
  proxy_pass http://127.0.0.1:端口/share/index.html;
  proxy_set_header X-Real-IP $remote_addr; 
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
  proxy_set_header Host $http_host; 
  proxy_redirect off;
  
  }
  location / {
  proxy_pass http://127.0.0.1:端口;
  proxy_set_header X-Real-IP $remote_addr; 
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
  proxy_set_header Host $http_host; 
  proxy_redirect off;
  
  }
}



server {
 	listen 443 ssl;
	server_name www.shmaur.com shmaur.com;
    client_max_body_size 500m;
       ssl_certificate  证书完整路径;
       ssl_certificate_key 证书完整路径;
       ssl_session_cache shared:SSL:1m;
       ssl_session_timeout 5m;
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
       ssl_ciphers TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:HIGH:!aNULL:!MD5;
    
	if ( $host != 'www.shmaur.com' ) {
		rewrite ^(.*)$ https://www.shmaur.com permanent;
	}

    	location =/ {
	proxy_pass http://127.0.0.1:端口/share/index.html; 
	proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Upgrade $http_upgrade;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
	proxy_set_header Host $http_host; 
    proxy_set_header Connection "upgrade";
	proxy_redirect off;
	}
  
	location / {
	proxy_pass http://127.0.0.1:端口/share/;
	proxy_set_header X-Real-IP $remote_addr; 
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
	proxy_set_header Host $http_host; 
	proxy_redirect off;
	}
}

“您的支持是我持续分享的动力”

微信收款码
微信
支付宝收款码
支付宝

黄金_shmaur
不积跬步,无以至千里;不积小流,无以成江海
目录关闭