I tried to migrate from Passenger to Puma in a Rails 5.2 project. This is a Docker setup using nginx to redirect from http to https and forward the requests to the Rails container. I had this set up perfectly working with Passenger. Since Puma is the preferred server by the Rails community, I tried to replace Passenger with Puma. After some hiccups, nginx and Puma found each other and the content was served, but every asset and static file was not found, I always got “301: Permanently moved”. The identical configuration had worked with Passenger though. (I think this could have been fixed if I had told Rails to serve static files, but I did not want to do this for performance reasons.)
Putting one of the URLs in question into wget gave me the following:
wget http://myserver.de/assets/application-606786f053f1b452d1089f9f5e4741add1d55c6d89223168b844dd9f21740aee.css
URL transformed to HTTPS due to an HSTS policy
--2024-07-08 16:21:27-- https://myserver.de/assets/application-606786f053f1b452d1089f9f5e4741add1d55c6d89223168b844dd9f21740aee.css
Auflösen des Hostnamens myserver.de (myserver.de)… xxx.xxx.xxx.xxx
Verbindungsaufbau zu myserver.de (myserver.de)|xxx.xxx.xxx.xxx|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://myserver.de/404.html [folgend]
--2024-07-08 16:21:27-- https://myserver.de/404.html
Wiederverwendung der bestehenden Verbindung zu myserver.de:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://myserver.de/404.html [folgend]
--2024-07-08 16:21:27-- https://myserver.de/404.html
Wiederverwendung der bestehenden Verbindung zu myserver.de:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
.
.
.
.
Translation:
- Auflösen des Hostnamens = Resolving host name
- Verbindungsaufbau zu = connecting to
- HTTP-Anforderung gesendet, auf Antwort wird gewartet = Http request sent, waiting for response
- Wiederverwendung der bestehenden Verbindung zu = reuse of existing connection to
Can anybody tell me what is wrong?