找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4562|回复: 2

[nginx相关的讨论] 如何安装Nextcloud后 在nginx中添加https

[复制链接]
发表于 2017-11-30 01:58 | 显示全部楼层 |阅读模式
本帖最后由 rangerwill 于 2017-11-30 21:20 编辑
  1. server {
  2.     listen      99;
  3.     server_name 域名;
  4.     root  /opt/wwwroot/Nextcloud/;
  5.     include     /opt/etc/nginx/conf/nextcloud.conf;
  6.     if ($host != 域名:99) {
  7.         return 301 https://域名:99$request_uri;
  8.     }
  9.     rewrite ^(.*)$ https://$server_name$1 permanent;
  10. }
  11. server {
  12.     listen      444;
  13.     server_name 域名;
  14.     ssl on;
  15.     root  /opt/wwwroot/Nextcloud/;
  16.     ssl_certificate /mnt/onmp/ssl/will.pem;
  17.     ssl_certificate_key /mnt/onmp/ssl/will.key;
  18.     ssl_session_timeout       5m;
  19.     ssl_protocols             TLSv1 TLSv1.1 TLSv1.2;
  20.     ssl_ciphers               ECDH;
  21.     ssl_session_cache         shared:SSL:50m;
  22.     ssl_prefer_server_ciphers on;
  23.     gzip on;
  24.     gzip_min_length 1k;
  25.     gzip_comp_level 2;
  26.     gzip_vary on;
  27.     gzip_disable "MSIE [1-6]\.";
  28.     error_page  497 https://$server_name:444$request_uri;
  29.     # error_page  404     /404.html;
  30.     # error_page  403     /403.html;
  31.     location / {
  32.         index index.html index.htm index.php tz.php;
  33.     }
  34.     location ~ .*\.(js|css)?$ {
  35.         expires 7d;
  36.         access_log off;
  37.     }
  38.     location ~ /\.ht {
  39.         deny all;
  40.     }
  41. }#
复制代码
uhttpd已经占用了80和443, 想用99[http]和444[https]访问nextcloud,请问这个配置哪里需要更改、、、、
另外 如果要在lede的nginx里用二级域名访问nextcloud的话,应该怎么设置?在下对于网页方面是个小白、求赐教、
十分感谢!

我的恩山、我的无线 The best wifi forum is right here.
发表于 2017-12-3 23:13 | 显示全部楼层
这不是我在群里发给你的嘛,要想不加端口号刚问网站,http只能用80端口,https只能用443端口,其他的需要加端口访问,比如https://域名:8443,二级域名就把nginx配置文件里的域名设置为二级域名呗

点评

应用了这个非常规80和443的规则之后 ,会出现400 the plain HTTP request was sent to HTTPS port的错误。所以我才发帖询问。  详情 回复 发表于 2017-12-6 17:59
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-12-6 17:59 来自手机 | 显示全部楼层
triton 发表于 2017-12-3 23:13
这不是我在群里发给你的嘛,要想不加端口号刚问网站,http只能用80端口,https只能用443端口,其他的需要加 ...

应用了这个非常规80和443的规则之后 ,会出现400 the plain HTTP request was sent to HTTPS port的错误。所以我才发帖询问。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 21:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表