Apps Manager

 How can i configure Html 5 push state in nginx server. i tried pushing nginx.conf file but nothing happending. Also i tried app.com/index.html responding with "502 Bad Gateway: Registered endpoint failed to handle the request."

Sathish kumar's profile image
Sathish kumar posted Jul 17, 2018 09:53 AM

 

Stephen Carter's profile image
Stephen Carter

Hi Sathish,

 

I'm not familiar with configuring push state but it sounds like it just needs some custom config in nginx.conf.

Can you confirm what buildpack you are using?

And what is the custom config you are adding to the nginx.conf?

 

 

Kind regards,

Stephen

Daniel Mikusa's profile image
Daniel Mikusa

With the Staticfile buildpack, you should just need to add a config option to your `Staticfile`. You'd want to add `pushstate: enabled`. Save the file & make sure it get's pushed with your app. The buildpack will see it and automatically adjust the Nginx config.

 

See here for more details:

 

https://docs.cloudfoundry.org/buildpacks/staticfile/index.html#config-process

 

 

Daniel Mikusa's profile image
Daniel Mikusa

>buildpack: https://github.com/cloudfoundry/staticfile-buildpack

 

For reference only. This will point your app to the master branch of the buildpack. That can change quite often and there are no guarantees that it is always functional. Instead, you want to use one of the system provided buildpack, which is what `buildpack: staticfile_buildpack` is doing, or you can reference one of the release tags off of Github. That would look like `buildpack: https://github.com/cloudfoundry/staticfile-buildpack#v1.4.29`. Referencing a release tag means that the buildpack you're referencing is stable, tested and won't change out from under you.

Sathish kumar's profile image
Sathish kumar

It is working now.

 

After changed manifest.yml file.

 

existing :

 

buildpack: https://github.com/cloudfoundry/staticfile-buildpack

path: ./build

memory: 64M

env:

FORCE_HTTPS: true

applications:

- name: dev-dispatch-master-ford-ride

 

new

 

buildpack: staticfile_buildpack

path: ./build

memory: 64M

env:

FORCE_HTTPS: true

applications:

- name: dev-dispatch-master-ford-ride