Nginx--阿里雲.

(2020-2-23 13:45:52)

[root@*** sbin]# ./nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
./nginx -c /usr/local/nginx/conf/nginx.conf  #使用上一步配置的nginx.conf啓動nginx服務

ps -aux | grep nginx

[root@*** sbin]# cat /usr/local/nginx/conf/nginx.conf

http {
**************************
**************************
######################## default ############################
  server {
    listen 80;
    server_name _;
    access_log /data/wwwlogs/access_nginx.log combined;
    root /data/wwwroot/default;
    index index.html index.htm index.jsp;
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    location /nginx_status {
      stub_status on;
      access_log off;
      allow 127.0.0.1;
      deny all;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
      expires 30d;
      access_log off;
    }
    location ~ .*\.(js|css)?$ {
      expires 7d;
      access_log off;
    }
    location ~ {
      proxy_pass http://127.0.0.1:8080;
      include proxy.conf;
    }
    location ~ ^/(\.user.ini|\.ht|\.git|\.svn|\.project|LICENSE|README.md) {
      deny all;
    }
  }
########################## vhost #############################
  include vhost/*.conf;
}

重點配置.文件.(2020-2-23 13:57:56)

查看訪問記錄.(2020-2-23 14:13:21)

/data/wwwlogs/access_nginx.log

Tomcat查看訪問記錄.(2020-2-23 14:13:39)

/root/apache-tomcat-9.0.31/logs

cat localhost_access_log.2020-02-20.txt
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章