Skip to content

Commit

Permalink
update nginx confix to fix https 422 error
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyc-z committed Jun 24, 2021
1 parent e0315a0 commit cc30908
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mimemagic (0.3.5)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_magick (4.11.0)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
Expand Down
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,38 @@ ps:数据库和上传的文件会保存在 ./shared 文件夹中
```

## 关于 https
1. https其实不属于本项目涉及的范畴,大家可以 google 一下 https 证书配置,挂 nginx 或者 apache 上都行,有条件的可以购买域名证书,没条件的自签名证书也是可以的
如果需要用到ipa下载,必须配置 https,举例 ng 的配置参考
```
//https_app.conf
server {
listen 443 ssl;
server_name ota.xxx.com;
# access_log /var/log/nginx/ota.xxx.com_access.log;
ssl_certificate /home/xxx.com/nginx/public.pem;
ssl_certificate_key /home/xxx.com/nginx/private.key;
ssl on;
location / {
proxy_set_header Host $http_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 https;
proxy_pass http://172.21.35.62:3000; #此处改为 docker 服务的地址
}
}
server {
listen 80;
server_name ota.xxx.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
```

## 已知问题
1. apk 包如果是非图片 logo,会无法显示 logo,因为目前还没实现 xml logo 的解析
2. 如果不配置 https,ipa 将无法安装
2. 如果不配置 https,ipa 将无法安装(苹果的限制)


## License
Expand Down
2 changes: 1 addition & 1 deletion docker/launcher
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ usage () {
set -e
set -o pipefail

version=0.2.0
version=0.2.1
local_port=3000
local_image=local_pluosi/app_host:$version
container_name=app_host
Expand Down
2 changes: 1 addition & 1 deletion docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ server {
proxy_set_header Host $http_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 X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $server_port;

if (!-f $request_filename) {
Expand Down

0 comments on commit cc30908

Please sign in to comment.