| 11 Nov 2023 |
szucsitg | In reply to @lily:lily.flowers can you ping me in like 5 hours? i'm running an event at the moment, but can help later I appreciate your time that you are trying to help me. I'm happy to learn from you, but I won't be online for long today as it's almost 10 PM. If you can provide any advice I'll follow up on it, how I should do it properly. However besides that there's 0 documentation around mkYarnWorkspace there's not many project on GitHub that uses it. I haven't tried it yet though. | 20:51:47 |
peter-lustig | ok Lily Foster, I am now a bit confused. I somehow need nginx and the systemd service, but how does this work? This is what I have now:
"example.com" = {
enableACME = true;
forceSSL = true;
root = inputs.myapp.packages.${pkgs.system}.default;
locations."/".proxyPass = "http://localhost:5173";
};
systemd.services.myapp = {
wantedBy = ["multi-user.target"];
after = ["network-online.target"];
serviceConfig = {
Type = "exec";
ExecStart = "ENV_VAR1="" ENV_VAR2="" ${pkgs.nodejs_20}/bin/node build";
WorkingDirectory = inputs.myapp.packages.${pkgs.system}.default;
Restart = "on-failure";
};
};
| 21:49:54 |
peter-lustig | the systemd servie runs that node build, but nginx does not | 21:50:24 |
Cobalt | In reply to @peter-lustig:matrix.org
ok Lily Foster, I am now a bit confused. I somehow need nginx and the systemd service, but how does this work? This is what I have now:
"example.com" = {
enableACME = true;
forceSSL = true;
root = inputs.myapp.packages.${pkgs.system}.default;
locations."/".proxyPass = "http://localhost:5173";
};
systemd.services.myapp = {
wantedBy = ["multi-user.target"];
after = ["network-online.target"];
serviceConfig = {
Type = "exec";
ExecStart = "ENV_VAR1="" ENV_VAR2="" ${pkgs.nodejs_20}/bin/node build";
WorkingDirectory = inputs.myapp.packages.${pkgs.system}.default;
Restart = "on-failure";
};
};
Why should the nginx service run the node build command? | 21:51:19 |
peter-lustig | In reply to @c0ba1t:matrix.org Why should the nginx service run the node build command? that is the command I need to run the application | 21:51:31 |
peter-lustig | start the app | 21:51:39 |
Cobalt | Okay, then nginx won't run any command. Your config only describes reverse proxy that redirects all requests (for the vhost) to the (presumable) service running on port 5173. | 21:53:36 |
Cobalt | Presumably, the systemd service starts a server on localhost:5137? | 21:55:22 |
peter-lustig | In reply to @c0ba1t:matrix.org Presumably, the systemd service starts a server on localhost:5137? yeah | 21:56:36 |
Cobalt | Okay, then that should work. If the systems service starts you should be good to go from the NodeJS side. | 21:57:36 |
peter-lustig | In reply to @c0ba1t:matrix.org Okay, then that should work. If the systems service starts you should be good to go from the NodeJS side. so you think what I have is correct? | 21:57:52 |
Cobalt | Maybe? You have only posted an excerpt from an NGINX vhost config with an `example.com` domain and a systemd unit. | 21:59:49 |
Cobalt | But it looks correct | 22:00:01 |
peter-lustig | In reply to @c0ba1t:matrix.org Maybe? You have only posted an excerpt from an NGINX vhost config with an `example.com` domain and a systemd unit. ok but I think that root = is useless then | 22:04:53 |
peter-lustig | i need proxypass for the backend though right? | 22:06:42 |
Cobalt | Yes | 22:08:33 |
Cobalt | Depending on the service you might also want `services.nginx.virtualHosts.<name>.locations.<name>.recommendedProxySettings` and `services.nginx.virtualHosts.<name>.locations.<name>.proxyPass` | 22:10:43 |
Cobalt | * Depending on the service you might also want `services.nginx.virtualHosts.<name>.locations.<name>.recommendedProxySettings` and `services.nginx.virtualHosts.<name>.locations.<name>.proxyPass` | 22:10:52 |
Cobalt | * Depending on the service you might also want `services.nginx.virtualHosts.<name>.locations.<name>.recommendedProxySettings` and `services.nginx.virtualHosts.<name>.locations.<name>.proxyWebsockets` | 22:11:11 |
| 12 Nov 2023 |
peter-lustig | ok Cobalt getting it started to fail | 01:14:37 |
peter-lustig | the systemd service | 01:14:39 |
peter-lustig | unfortunately there are no closer details | 01:14:45 |
peter-lustig | but I get bad gateway on nginx | 01:16:50 |
peter-lustig | so idk | 01:16:53 |
peter-lustig | please help if you have an idea | 01:53:06 |
Cobalt | The NGINX bad gateway error is NGINX's way of reporting that it couldn't reach the service behind proxy pass. | 08:17:05 |
Cobalt | In reply to @peter-lustig:matrix.org the systemd service You might want to look into the journal (journalctl -xeu ) to inspect your app logs. | 08:18:18 |
Cobalt | * In reply to @peter-lustig:matrix.org
the systemd service
If your app öogs to stderr/stdout, you might want to look into the journal (journalctl -xeu ) to inspect your app logs | 08:19:24 |
Cobalt | * In reply to peter-lustig
the systemd service
If your app logs to stderr/stdout, you might want to look into the journal (journalctl -xeu ) to inspect your app logs
| 08:19:51 |
peter-lustig | In reply to @c0ba1t:matrix.org
In reply to peter-lustig the systemd service
If your app logs to stderr/stdout, you might want to look into the journal (journalctl -xeu ) to inspect your app logs Yes, I am aware of that. But journalctl for the service only gives me `The unit has entered the 'failed' state with result 'exit-code' | 13:10:21 |