概述
一:下载nginx方式
1.yum install nginx
2.源码安装
二:学习网址
nginx documentation — DevDocs
三:配置文件信息
server { listen 80 ; listen [::]:80 ipv6only=on; listen 443 default ssl; listen [::]:443 default ssl; #listen [::]:443 ssl ; #listen 443 ssl; ssl off; ssl_certificate /etc/nginx/sslkey/kcs.default.crt; ssl_certificate_key /etc/nginx/sslkey/kcs.default.key; server_name test1116.com; #max_ranges 0; autoindex on; autoindex_exact_size off; autoindex_localtime on; error_log /var/log/nginx/error.log; access_log /var/log/nginx/access.log; #302跳转使用 location = /test302.html { root html; rewrite ^/(.*)$ http://127.0.0.1/a/123.mp4 redirect; } location = /index12.html { root /home/root/auto_test/Report/html/; } location /a/ { root html; rewrite ^/(.*)$ http://127.0.0.1/b/123.mp4 redirect; }
# 配合html/php上传文件使用 location ~ .*.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; client_max_body_size 30m; # fastcgi_param HTTPS on; fastcgi_param HTTPS $https if_not_empty; fastcgi_param SCRIPT_FILENAME /etc/nginx/html$fastcgi_script_name; include fastcgi_params; #include fastcgi.conf; } error_page 405 =200 $uri; #error_page 405 =200 @405; #location @405 { # root /etc/nginx/html; #root /tmp/upload_tmp2; # proxy_method GET; #} #location /b { # root html; # rewrite /(.*) http://127.0.0.1/c/yunkong.mp4 redirect; # } #location /c { # root html; # rewrite /(.*) http://127.0.0.1/d/yunkong.mp4 redirect; # } #location /d { # root html; #} location /refresh30.html { expires 30s; root html; } location ~^/.* { root /etc/nginx/html; add_header 123 123; #添加请求接口响应头信息 gzip on; #响应信息是否进行压缩 # gzip_types text/html text/plain application/javascript application/x-javascript text/javascript text/xml text/css; #gzip_vary on; } }
转载于:https://www.cnblogs.com/HYanqing/p/11271974.html
最后
以上就是单薄电脑为你收集整理的【原】nginx配置文件的全部内容,希望文章能够帮你解决【原】nginx配置文件所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复