Ish: nginx doesn’t work.

Created on 1 Dec 2018  ·  25Comments  ·  Source: ish-app/ish

I tried to run nginx and it shows “bad system call” when I try to test the config file.

Diegos-iPad:~# nginx -v 

nginx version: nginx/1.14.1  

Diegos-iPad:~# nginx -t          

Bad system call            

Diegos-iPad:~# 

Most helpful comment

Port 80 is generally allowed, in fact there are app store apps (such as VLC) that run web servers on port 80. More likely nginx is broken.

All 25 comments

Could you run dmesg and tell me which missing syscall it is?

of course, give me a sec

Diegos-iPad:~# dmesg                                                                                             
15 missing syscall 329                                                                                           
15 missing syscall 329

That's epoll_create1. It's going to be a bit before I get epoll working.

Ok, thanks. I'll keep playing with the app. Kudos for it. So far I'm super impressed. BTW, that reply speed was totally unexpected

epoll should be working now. I don't know if that means nginx is fixed though.

I just tried it and it says:

Diegos-iPad:~# nginx -v                                                                                                                    
nginx version: nginx/1.14.1                                                                                                                
Diegos-iPad:~# nginx -t                                                                                                                    
Bad system call                                                                                                                            
Diegos-iPad:~# dmesg                                                                                                                       
3 missing syscall 329

Is the fix coming in a new build? I have build (37)

Sent with GitHawk

I'm about to push build 38, try again once you've updated.

Sure, I’ll try that as soon as I install the update

Sent with GitHawk

It no longer causes a bad system call, it throws an error due to a file not being found but I’m assuming that’s an error in the package, I’ll try later to investigate further.

Sent with GitHawk

That sounds like it could be #217

Maybe but I’m guessing it’s an error when nginx tries to call some function to check there’s an instance of nginx running or something like that. There’s no bad system call though, also dmesg returns nothing. The actual error is:

Diego:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok                                            
nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)                          
nginx: configuration file /etc/nginx/nginx.conf test failed                                                 
Diego:~#

I checked and indeed there’s no file there, i manually created one and now when I run “nginx -t” iSH crashes HARD. I tried removing the file but that didn’t help. I had to delete and reinstall the app.

I tried to run nginx in ISH on my Ipad. At first everything seemed to work well. nginx -t gave me success messages. Nevertheless, the welcome page of nginx was never accessible. The error log read:
2019/11/27 14:03:18 [alert] 223#0 ioctl(FIOASYNC) failed while spawning "worker process"(25:not a tty)
I configure worker process auto in nginx.conf. Is this my problem or because ISH doesn't support nginx at present?

nginx uses an obscure api for worker processes that ish doesn't support. I know it works with daemon off and worker_process off.

Thank you for the reply.
Daemon off and work _processes off do not produce any error messages in log, but the welcome page of nginx is still inaccessible. I’m sure l’m visiting the right port...

How do you start nginx? I looked it up for alpine and rc-service is not a command in ish.

openrc is not working yet, you have to manually run nginx.

nginx uses an obscure api for worker processes that ish doesn't support. I know it works with daemon off and worker_process off.

I'm sorry for bumping this issue from last year, but I was also trying to use nginx from iSH a while ago. I had to manually create the /run/nginx/ directory to fix the nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory) error, and I followed the advice by @tbodt quoted above to no avail. The error.log didn't have anything saved from the time I started it to the time I closed it and the access.log is completely empty. dmesg doesn't show any output, so I'm not sure where the issue is coming from.

I'm trying to run nginx too now, it's running without error but I can't seem to call port 80 or port 81 in the browser.

I tried running a web server using gunicorn on port 8000 and it is working fine. I'm not sure if I miss a configuration for nginx to run properly.

Those ports are restricted on iOS if I remember correctly. Try using something in the 2000s

I have given up for nginx to work on iSH for now.

I'll just use python3's http.server to host static html then gunicorn to run REST apis.

python3 -m http.server 80
gunicorn rest:api

Those ports are restricted on iOS if I remember correctly. Try using something in the 2000s

I had a feeling it had something to do with this. I would say find some way to get past this (other than changing the port number to >1024) but that would most definitely get the app removed from the App Store. Maybe there's some way that the app could reject the port bind calls for anything below 1024 that way users aren't confused about why nginx or any other program is "listening" on that port but not actually working.

Those ports are restricted on iOS if I remember correctly. Try using something in the 2000s

I had a feeling it had something to do with this. I would say find some way to get past this (other than changing the port number to >1024) but that would most definitely get the app removed from the App Store. Maybe there's some way that the app could reject the port bind calls for anything below 1024 that way users aren't confused about why nginx or any other program is "listening" on that port but not actually working.

I was able to run a webserver on port 80 using this command:

python3 -m http.server 80

@tbodt or @saagarjha may have to chime in then

Port 80 is generally allowed, in fact there are app store apps (such as VLC) that run web servers on port 80. More likely nginx is broken.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BrammyH picture BrammyH  ·  3Comments

fernandotcl picture fernandotcl  ·  4Comments

saman1111111 picture saman1111111  ·  4Comments

sirredbeard picture sirredbeard  ·  3Comments

balboah picture balboah  ·  5Comments