Adnan Pirota
Adnan Pirota

Reputation: 309

Rails generates wrong asset url in production (with localhost instead of server ip)

Rails 6 in production generates wrong asset path url with http://localhost:3000/xxxxxx

When I replace http://localhost:3000 with server IP assets load fine, so it's just url generation error by rails.

System is run on digital ocean with Passanger on Nginx.

Upvotes: 0

Views: 585

Answers (1)

Alex Shkolnikov
Alex Shkolnikov

Reputation: 124

Try to add config.action_controller.asset_host = "assets.example.com" to /config/environments/production.rb

Upvotes: 1

Related Questions