An open API service indexing awesome lists of open source software.

https://github.com/rnons/nginx-in-nix-shell-issue

Fix by pin to 19.03 HEAD
https://github.com/rnons/nginx-in-nix-shell-issue

Last synced: 3 months ago
JSON representation

Fix by pin to 19.03 HEAD

Awesome Lists containing this project

README

          

I have a `nginx.conf` that looks like this

```
server {
listen 3000;
server_name ~^(?.+)\.localhost$;
root www/$sub;
}
```

And `www/hello/index.html` contains only `hello world` text.

The idea is `http://hello.localhost` will be served from `www/hello` directory. Using system-wide nginx works fine, however, when I run nginx in nix-shell, I get 500 error without any more error message.

## run nginx in nix-shell

```
nix-shell -p nginx --run "nginx -p . -c nginx.conf"
# or
nix-shell -I nixpkgs=http://github.com/NixOS/nixpkgs/archive/e199c174c69f196301de2ad2d5d87c76a822a558.tar.gz -p nginx --run "nginx -p . -c nginx.conf"
```

```
% curl hello.localhost:3000

500 Internal Server Error

500 Internal Server Error



nginx/1.16.0

```

## run system wide nginx

```
sudo nginx -p . -c nginx.conf
```

```
% curl hello.localhost:3000

hello world
```