[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: 404 on path based route



It works now.

I was mistaken in thinking that `/static` in the route would map to `/` in the service (like proxy_pass). After creating a `/static` dir in the home-nfs service I can now access the content.

Now I just need to create an apache alias using .htaccess or move my content under `/static` in my home-nfs service.

Thank you, Ram.

----- On Apr 5, 2016, at 11:45 AM, Ram Ranganathan <rrangana redhat com> wrote:
The 404 is being returned back from your apache service (see Server: header) - maybe that is not configured correctly? 
You can check directly against your apache service by removing the proxy (haproxy) out of the mix and 
curling the pod/endpoint directly ala: 
   $  curl -H "Host: hello-flask-dale.os.example.com"   http://10.1.7.11:8080/static/index.html

HTH

On Tue, Apr 5, 2016 at 10:33 AM, Dale Bewley <dale bewley net> wrote:
Using OSEv3.1.1

I have an app with a dynamic and static content. I'm trying to manipulate routes such that / is served by the dynamic gunicorn service and /static is served by a simple apache service.

Configured as follows, I am seeing a 404 on my /static route. Am I missing something obvious?


$ oc describe service hello-flask
Name:                   hello-flask
Namespace:              dale
Labels:                 app=hello-flask
Selector:               deploymentconfig=hello-flask
Type:                   ClusterIP
IP:                     172.30.15.193
Port:                   8080-tcp        8080/TCP
Endpoints:              10.1.6.6:8080
Session Affinity:       None
No events.

$ oc describe service home-nfs
Name:                   home-nfs
Namespace:              dale
Labels:                 template=static-webserver
Selector:               name=home-nfs
Type:                   ClusterIP
IP:                     172.30.206.133
Port:                   web     8080/TCP
Endpoints:              10.1.7.11:8080
Session Affinity:       None
No events.

$ oc describe route hello-flask
Name:                   hello-flask
Created:                13 days ago
Labels:                 app=hello-flask
Annotations:            openshift.io/generated-by=OpenShiftWebConsole
                        openshift.io/host.generated=true
Host:                   hello-flask-dale.os.example.com
Path:                   <none>
Service:                hello-flask
TLS Termination:        <none>
Insecure Policy:        <none>

$ oc describe route static-content-test
Name:                   static-content-test
Created:                20 hours ago
Labels:                 template=static-webserver
Host:                   hello-flask-dale.os.example.com
Path:                   /static                 <----- notice!
Service:                home-nfs
TLS Termination:        <none>
Insecure Policy:        <none>


$ curl -I home-nfs-dale.os.example.com/index.html
HTTP/1.1 200 OK
Date: Tue, 05 Apr 2016 16:53:47 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Sat, 19 Mar 2016 01:01:17 GMT
ETag: "4-52e5c669fdc84"
Accept-Ranges: bytes
Content-Length: 4
Content-Type: text/html; charset=UTF-8
Set-Cookie: OPENSHIFT_dale_home-nfs_SERVERID=10.1.7.11:8080; path=/; HttpOnly
Cache-control: private

$ curl -I hello-flask-dale.os.example.com
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 100
Server: Werkzeug/0.8.3 Python/2.7.8
Date: Tue, 05 Apr 2016 16:53:50 GMT
Set-Cookie: OPENSHIFT_dale_hello-flask_SERVERID=10.1.6.6:8080; path=/; HttpOnly
Cache-control: private
Connection: keep-alive

$ curl -I hello-flask-dale.os.example.com/static/index.html
HTTP/1.1 404 Not Found                    <----- notice!
Date: Tue, 05 Apr 2016 16:53:56 GMT
Server: Apache/2.4.6 (CentOS)
Content-Type: text/html; charset=iso-8859-1
Set-Cookie: OPENSHIFT_dale_static-content-test_SERVERID=10.1.7.11:8080; path=/; HttpOnly

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users



--
Ram//
main(O,s){s=--O;10<putchar(3^O?97-(15&7183>>4*s)*(O++?-1:1):10)&&\
main(++O,s++);}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]