ronzeidman / ng2-ui-auth

an angular2 repository for authentication based on angular1's satellizer
MIT License
206 stars 64 forks source link

deploying ng2-ui-auth-example to a public domain #151

Closed tuhin24 closed 6 years ago

tuhin24 commented 6 years ago

Hello Ron,

I am trying to deploy my app to my domain and having some difficulties. It works fine using localhost.

I put my node server on an azure domain which is running on port 3000. I can access it from outside.

I built the client using ng build --prod and copied everything from dist folder to my domain at hostgator.com . Now I can access my domain directly without any port. When I click on login to facebook, I get facebook's login dialog. Once I put my credentials. I get the following error: "Http failure response for http://www.mydomain.com/auth/facebook: 404 Not Found"

Any tip on how to fix this?

Regards,

ronzeidman commented 6 years ago

Sorry I wasn't available in the past few months, anyway I'm guessing the question is no longer relevant but just for reference, if your server returns 404 try to test it using postman.

tuhin24 commented 6 years ago

Hello Ron, I may have found the problem I am facing in my production environment. In my example, I have a proxy.conf.json file that has.

{ "/auth": { "target": "http://localhost:3000" } } In my dev env I run it using: ng serve --proxy-config proxy.conf.json --aot and it works fine.

For production environment, I build it using ng build --prod

I copy the file from dist folder to my Apache server. Unfortunately, in production proxy.conf.json not used. so any call to http://www.mydomain.com/auth/facebook fails. I am stuck here for a week. Any help is highly appreciated. Thanks

ronzeidman commented 6 years ago

Read here: https://angular.io/guide/deployment#server-configuration

There is a specific section there about Apache configuration. Read it carefully since you'll need to understand why and how the configuration works.

On Sun, Oct 14, 2018, 02:48 tuhin24 notifications@github.com wrote:

Hello Ron, I may have found the problem I am facing in my production environment. In my example, I have a proxy.conf.json file that has.

{ "/auth": { "target": "http://localhost:3000" } } In my dev env I run it using: ng serve --proxy-config proxy.conf.json --aot and it works fine.

For production environment, I build it using ng build --prod

I copy the file from dist folder to my Apache server. Unfortunately, in production proxy.conf.json not used. so any call to http://www.mydomain.com/auth/facebook fails. I am stuck here for a week. Any help is highly appreciated. Thanks

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ronzeidman/ng2-ui-auth/issues/151#issuecomment-429584489, or mute the thread https://github.com/notifications/unsubscribe-auth/ANWmx6sxjLvhYJlHbRO7oiKGkdqWXXx3ks5uknvigaJpZM4Wh-Za .