1a - For Arm devices setup Debian from here
1b - For Mipsel devices setup Debian from here
2 - Enter Chrooted Debian
3 - Update Debian
apt-get upgrade
4 - Install necessary packages
5 - Replace default configuration file
nano /etc/nginx/sites-available/default
Paste this lines
server { listen 82; ## listen for ipv4; this line is default and implied listen [::]:82 default_server ipv6only=on; ## listen for ipv6 root /usr/share/nginx/html; index index.html index.htm; # Make site accessible from https://localhost/ server_name localhost; # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock location ~ .php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } }
Save with CTRL-O, press ENTER and exit nano with CTRL-X
6 - Reduce memory limit
7 - Restart server
service nginx restart
8 - Go to 192.168.1.1:82 and if you see this page, the nginx web server is configured correctly
9 - Create php info page
Paste this lines
<?php phpinfo(); ?>
Save with CTRL-O, press ENTER and exit nano with CTRL-X
10 - Go to 192.168.1.1:82/info.php and if you see this page, php is configured correctly
11 - To create startup script we need to exit debian
12- Add nginx to chrooted services list
echo "php5-fpm" >>/opt/etc/chroot-services.list
13 - Start nginx from outside debian together with mounted external folder
ACCESS THE WEBSITE FROM WAN
Paste this lines
#!/bin/sh
iptables -I INPUT -p tcp --destination-port 82 -j ACCEPT
sh /jffs/scripts/firewall-start
Go to Port Forwarding page https://192.168.1.1/Advanced_VirtualServer_Content.asp and redirect port 80 to 82, now you should have access from wan.