1

I have a RPi running nginx as a web-server (default installation except /var/www as default directory), but I can only access it inside LAN.

I followed this tutorial and in sites-available I created a file with the following code:

server {
 listen 80;
 root /var/www;
 index index.php index.html index.htm;

 location ~ \.php$ {
  fastcgi_pass unix:/var/run/php5-fpm-sock;
  fastcgi_index index.php;
  include fastcgi_params;
 }
}

What do I need to do to make it accessible from outside my network?

13
  • forward port 80 to the PI. Please search this Q&A as it has been answered a million times across all the sites.
    – Piotr Kula
    Oct 24 '13 at 10:33
  • I actually have port set to 80, atleast in the sites-available directory, I'll add that to the question. Where do you mean I need to set the port? I'm sorry if my question is repetitive but I couldn't find the answer by searching. Oct 24 '13 at 10:49
  • raspberrypi.stackexchange.com/a/9764/894 Please concnetrate on the part that is highlighted as What is port forwarding? near the bottom of the answer.
    – Piotr Kula
    Oct 24 '13 at 12:02
  • @ppumkin Actually that question is far from what I'm asking, a relevant link in the bottom of an answer to a completely unrelated question does not make this a duplicate of that question. That being said I still appreciate the link as it included a good understanding of what port forwarding is, why we use it and how it works. But I still don't know how to apply it to my RPi, I'm new to linux and don't even know where to start, I will however start by making sure the router is configured correctly. Oct 24 '13 at 12:32
  • The first problem is that you still think that is all unrelated. So in case you missed it while reading the articles that were linked... You need to log into your rootuer, forwards port 80 TCP from WAN to port 80 of RaspberryPi. Then use whatsmyIP, use a remote computer or 3G on your phone and type it in... Your Pi Site should show. You can use Dynamic DNS to update your IP on the global network. Go and read the links... again. slowly.
    – Piotr Kula
    Oct 24 '13 at 12:51

Browse other questions tagged or ask your own question.