Search code examples
nginxluawebserveropenrestylapis

Lapis - 403 error when accessing /static/ directory. Lapis unable to use port 80


I have Lapis installed and working on Debian 9. I have two beginner issues I need to solve running the simple init setup that serves static content from /static/ and the Lua app from all other requests:

  1. I put an index.html file in a directory called static which is in the same directory I start Lapis from, but attempting to access via IP/static/index.html results in a 403 access error.
  2. I cannot set the server to use port 80 because the address is already in use by nginx (confirmed with netstat). There is a "Welcome to OpenResty!" page served there, with the Lapis app only being served on other set ports.

I'd appreciate any advice that would solve these issues. Also any pointers towards documentation that fully describes the relationship between nginx, OpenResty and Lapis would be very helpful.


Solution

  • Thanks to help from LordRyan on the moonscript IRC the issues are solved.

    1. The 403 issue was a permission error caused by the Lapis app directory being at root level.
    2. Inability to use port 80 was caused by an nginx instance running in the background which was discovered using...

      ps aux | grep nginx root
      

      ... shutting it down solved the issue and gave the Lapis app control.