You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/09/14 06:11:40 UTC
[GitHub] [apisix] akgn-git opened a new issue, #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
akgn-git opened a new issue, #7912:
URL: https://github.com/apache/apisix/issues/7912
### Current Behavior
**my upstream config**
`{
"nodes": [
{
"host": "192.168.57.110",
"port": 8083,
"weight": 1
}
],
"timeout": {
"connect": 6,
"send": 6,
"read": 6
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass",
"name": "test_192.168.57.110_upstream",
"desc": "test_192.168.57.110_upstream",
"keepalive_pool": {
"idle_timeout": 60,
"requests": 1000,
"size": 320
}
}`
**my route config:**
`{
"uri": "/a/*",
"name": "test_192.168.57.110_route",
"desc": "192.168.57.110",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE"
],
"plugins": {
"proxy-rewrite": {
"regex_uri": [
"^/a/(.*)",
"/$1"
]
},
"redirect": {
"http_to_https": true
}
},
"upstream_id": "425463001374524102",
"labels": {
"192.168.57.110": "192.168.57.110",
"API_VERSION": "v1"
},
"enable_websocket": true,
"status": 1
}`
**my apisix config**
```
apisix:
node_listen: 80
ssl:
enable: true
listen_port:
- 443
enable_ipv6: false
allow_admin:
- 0.0.0.0/0
admin_listen:
port: 9001
admin_key:
- name: "admin"
key: test_admin_key
role: admin
- name: "viewer"
key: test_viewer_key
role: viewer
enable_control: false
control:
ip: "0.0.0.0"
port: 9092
etcd:
host:
- "http://etcd:2379"
prefix: "/apisix"
timeout: 30
```
**my docker-compose.yml**
```
version: "3"
services:
apisix-dashboard:
image: apache/apisix-dashboard:2.13-alpine
restart: always
volumes:
- ./dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml
ports:
- "9000:9000"
networks:
apisix:
apisix:
image: apache/apisix:2.15.0-alpine
restart: always
volumes:
- ./apisix_log:/usr/local/apisix/logs
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
depends_on:
- etcd
##network_mode: host
ports:
- "80:80/tcp"
- "443:443/tcp"
- "9001:9001/tcp"
networks:
apisix:
etcd:
image: bitnami/etcd:3.4.15
restart: always
volumes:
- etcd_data:/bitnami/etcd
environment:
ETCD_ENABLE_V2: "true"
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
networks:
apisix:
networks:
apisix:
driver: bridge
volumes:
etcd_data:
driver: local
```
_**my source server http://192.168.57.110:8083/doc.html**_
### *visit http://127.0.0.1/a/doc.html Redirected to by https://127.0.0.1/a/doc.html . But it doesn't work.*
![1](https://user-images.githubusercontent.com/98728148/190067125-95726b62-8f5e-4e9c-b9cc-565497663c5c.png)
![2](https://user-images.githubusercontent.com/98728148/190067154-f547fd71-d914-45ba-b613-d6f9acdad7f7.png)
### Expected Behavior
### http://127.0.0.1/a/doc.html Redirected to https://127.0.0.1/a/doc.html
### Error Logs
_No response_
### Steps to Reproduce
[docker-compose-customer-example.zip](https://github.com/apache/apisix/files/9563191/docker-compose-customer-example.zip)
unzip docker-compose-customer-example.zip
`docker-compose -p docker-apisix up -d`
### Environment
docker pull
apache/apisix-dashboard:2.13-alpine
apache/apisix:2.15.0-alpine
bitnami/etcd:3.4.15
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #7912:
URL: https://github.com/apache/apisix/issues/7912#issuecomment-1246542220
> listen_port
But why a bad form will make APISIX returns 500. It should be checked before.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #7912:
URL: https://github.com/apache/apisix/issues/7912#issuecomment-1246540966
```
listen_port:
- 443
```
maybe bad form, try with
```
apisix:
ssl:
enable: true
listen:
- 443
```
ref: https://github.com/apache/apisix/blob/4fb18b0d5d1e5be707712836379defcfe638c7eb/conf/config-default.yaml#L131-L141
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] akgn-git commented on issue #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
Posted by GitBox <gi...@apache.org>.
akgn-git commented on issue #7912:
URL: https://github.com/apache/apisix/issues/7912#issuecomment-1246770744
> ```
> listen_port:
> - 443
> ```
>
> maybe bad form, try with
>
> ```
> apisix:
> ssl:
> enable: true
> listen:
> - 443
> ```
>
> ref:
>
> https://github.com/apache/apisix/blob/4fb18b0d5d1e5be707712836379defcfe638c7eb/conf/config-default.yaml#L131-L141
Great, it works,thank
> ```
> listen_port:
> - 443
> ```
>
> maybe bad form, try with
>
> ```
> apisix:
> ssl:
> enable: true
> listen:
> - 443
> ```
>
> ref:
>
> https://github.com/apache/apisix/blob/4fb18b0d5d1e5be707712836379defcfe638c7eb/conf/config-default.yaml#L131-L141
**Great, it works,thank**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] akgn-git closed issue #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
Posted by GitBox <gi...@apache.org>.
akgn-git closed issue #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
URL: https://github.com/apache/apisix/issues/7912
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #7912: bug: route http_to_https not working. stack traceback: redirect.lua: in function 'phase_func'
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #7912:
URL: https://github.com/apache/apisix/issues/7912#issuecomment-1246823496
> But why a bad form will make APISIX returns 500. It should be checked before.
Perhaps it was not checked. anyway, this configuration has been removed in 3.0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org