EduSoho网络教学软件 加入小组

537个成员 301个话题 创建时间:2013-09-17

UPUPW的Nginx版本如何实现局域网内直接输入IP访问EduSoho教程

发表于 2013-12-04 8738 次查看

1: 首先备份原来的配置文件vhosts.conf

就是把这个文件的名字修改成vhosts.conf.backup

2: 然后重新创建vhosts.conf文件

里面的内容替换成以下文字

server {
listen 80;
server_name 192.168.1.6 localhost alias 127.0.0.1;  #最前面的IP改成当前机器IP
root D:/upupw/edusoho/web;
access_log D:/upupw/Nginx/logs/edusoho-rc.com.access.log;
error_log D:/upupw/Nginx/logs/edusoho-rc.com.error.log;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}

location ~ ^/udisk {
internal;
root D:/upupw/edusoho/app/data/;
}

location ~* \.(jpg|jpeg|gif|png|ico|swf)$ {
expires 3y;
access_log off;
gzip off;
}

location ~* \.(css|js)$ {
access_log off;
expires 3y;
}

location ~ ^/files/.*\.(php|php5)$ {
deny all;
}

location ~ ^.+\.php {
fastcgi_pass bakend;
fastcgi_index app.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param HTTPS off;
include fastcgi.conf;
include fastcgi_params;
}

location ~ ^/(app|app_dev)\.php(/|$) {
fastcgi_pass bakend;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect;
fastcgi_param HTTP_X-Accel-Mapping /udisk=/D:/upupw/edusoho/app/data/udisk;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
}

}
#server localhost end}

3: 然后关闭Window操作系统的防火墙

4: 最后重新启动upupw。

先输入“s5”,再输入“s1”。

最后在浏览器中输入你自己的当前机器的IP地址就可以了。

发表回复
功能维护升级中,维护完成完后将再次开放,非常抱歉给您学习造成的不便。