zoukankan      html  css  js  c++  java
  • 配置nginx局域网内可访问

    1. #本机  
    2. server {  
    3.         listen       80;  
    4.         server_name  www.stat.me ;  
    5.         root   "E:/lein/rkts/rkts/code/stat/public";  
    6.           
    7.         autoindex off;  
    8.   
    9.         location / {  
    10.           index  index.html index.htm index.php;  
    11.           #try_files $uri $uri/ /server.php?/$uri;  
    12.           try_files $uri $uri/ /index.php?$query_string;  
    13.         }  
    14.   
    15.         location ~ .php(.*)$ {  
    16.             fastcgi_pass   127.0.0.1:9000;  
    17.             fastcgi_index  index.php;  
    18.             fastcgi_split_path_info  ^((?U).+.php)(/?.+)$;  
    19.             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
    20.             fastcgi_param  PATH_INFO  $fastcgi_path_info;  
    21.             fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;  
    22.             include        fastcgi_params;  
    23.         }  
    24. }  
    25.   
    26. #供局域网内其他机器访问  
    27. server {  
    28.         listen       8090;  
    29.         server_name  192.168.115.197:8090 ;  
    30.         root   "E:/lein/rkts/rkts/code/stat/public";  
    31.           
    32.         autoindex off;  
    33.   
    34.         location / {  
    35.           index  index.html index.htm index.php;  
    36.           #try_files $uri $uri/ /server.php?/$uri;  
    37.           try_files $uri $uri/ /index.php?$query_string;  
    38.         }  
    39.   
    40.         location ~ .php(.*)$ {  
    41.             fastcgi_pass   127.0.0.1:9000;  
    42.             fastcgi_index  index.php;  
    43.             fastcgi_split_path_info  ^((?U).+.php)(/?.+)$;  
    44.             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
    45.             fastcgi_param  PATH_INFO  $fastcgi_path_info;  
    46.             fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;  
    47.             include        fastcgi_params;  
    48.         }  
    49. }  
  • 相关阅读:
    12月4日
    12月3日
    12月2日
    12月1日
    11月30日
    11月29日
    11月28日
    11月27日
    jquery mobile-按钮控件
    ap web
  • 原文地址:https://www.cnblogs.com/gakuki/p/7911605.html
Copyright © 2011-2022 走看看