current position:Home>How to configure nginx server under Windows system

How to configure nginx server under Windows system

2022-04-29 19:26:43Billion cloud speed

Windows Under the system Nginx How to configure the server

This article mainly explains “Windows Under the system Nginx The server How to configure ”, Interested friends might as well come and have a look . The method introduced in this paper is simple and fast , Practical . Now let Xiaobian take you to learn “Windows Under the system Nginx How to configure the server ” Well !

start-up nginx

cd d:cd nginx-1.2.4start nginx

Check the task manager. There will be nginx The process of
Type in the browser http://127.0.0.1 This will bring up nginx Welcome interface for , Instructions start nginx success .

welcome to nginx!if you see this page, the nginx web server is successfully installed and working. further configuration is required.for online documentation and support please refer to nginx.org.commercial support is available at nginx.com.thank you for using nginx.

Other operating :

nginx -s stop     //  stop it nginxnginx -s reload    //  Reload the configuration file nginx -s quit     //  sign out nginx

The configuration file :

#user nobody; worker_processes 1;# Number of threads started : The number of cores in a book *2 # Wrong location and level  #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;  #pid    logs/nginx.pid;#pid Location of process file    events {   worker_connections 1024;# Maximum connections per process  }   http {   include    mime.types;   default_type application/octet-stream;   #nginx Log format definition , You can quote below    #log_format main '$remote_addr - $remote_user [$time_local] "$request" '   #         '$status $body_bytes_sent "$http_referer" '   #         '"$http_user_agent" "$http_x_forwarded_for"';    #access_log logs/access.log main;# Log path     sendfile    on;   #tcp_nopush   on;    #keepalive_timeout 0;   keepalive_timeout 65;# Request time     #gzip on; Turn on gzip Compress    #server Virtual machine set for , Multiple can be set    server {     listen    80;# Listening port      server_name localhost;# Monitored domain name       #charset koi8-r;      #access_log logs/host.access.log main;# Where the virtual machine logs are stored       location / {       root  html;       index index.html index.htm;     }      #error_page 404       /404.html;      # redirect server error pages to the static page /50x.html     #     error_page  500 502 503 504 /50x.html;     location = /50x.html {       root  html;     }      # proxy the php scripts to apache listening on 127.0.0.1:80     #     #location ~ \.php$ {     #  proxy_pass  http://127.0.0.1;     #}      # pass the php scripts to fastcgi server listening on 127.0.0.1:9000     #     #location ~ \.php$ {     #  root      html;     #  fastcgi_pass  127.0.0.1:9000;     #  fastcgi_index index.php;     #  fastcgi_param script_filename /scripts$fastcgi_script_name;     #  include    fastcgi_params;     #}      # deny access to .htaccess files, if apache's document root     # concurs with nginx's one     #     #location ~ /\.ht {     #  deny all;     #}   }     # another virtual host using mix of ip-, name-, and port-based configuration   #   #server {   #  listen    8000;   #  listen    somename:8080;   #  server_name somename alias another.alias;    #  location / {   #    root  html;   #    index index.html index.htm;   #  }   #}     # https server   #   #server {   #  listen    443;   #  server_name localhost;    #  ssl         on;   #  ssl_certificate   cert.pem;   #  ssl_certificate_key cert.key;    #  ssl_session_timeout 5m;    #  ssl_protocols sslv2 sslv3 tlsv1;   #  ssl_ciphers high:!anull:!md5;   #  ssl_prefer_server_ciphers  on;    #  location / {   #    root  html;   #    index index.html index.htm;   #  }   #}  }

tip :
   function nginx -v You can view which modules the compiled version of the platform supports . The result here is for me :

nginx version: nginx/0.7.65   tls sni support enabled   configure arguments:   --builddir=objs.msvc8   --crossbuild=win32   --with-debug --prefix=   --conf-path=conf/nginx.conf   --pid-path=logs/nginx.pid   --http-log-path=logs/access.log   --error-log-path=logs/error.log   --sbin-path=nginx.exe   --http-client-body-temp-path=temp/client_body_temp   --http-proxy-temp-path=temp/proxy_temp   --http-fastcgi-temp-path=temp/fastcgi_temp   --with-cc-opt=-dfd_setsize=1024   --with-pcre=objs.msvc8/lib/pcre-7.9   --with-openssl=objs.msvc8/lib/openssl-0.9.8k   --with-openssl-opt=enable-tlsext   --with-zlib=objs.msvc8/lib/zlib-1.2.3   --with-select_module   --with-http_ssl_module   --with-http_realip_module   --with-http_addition_module   --with-http_sub_module   --with-http_dav_module   --with-http_stub_status_module   --with-http_flv_module   --with-http_gzip_static_module   --with-http_random_index_module   --with-http_secure_link_module   --with-mail   --with-mail_ssl_module   --with-ipv6     nginx version: nginx/0.7.65  tls sni support enabled  configure arguments:   --builddir=objs.msvc8   --crossbuild=win32   --with-debug --prefix=   --conf-path=conf/nginx.conf   --pid-path=logs/nginx.pid   --http-log-path=logs/access.log   --error-log-path=logs/error.log   --sbin-path=nginx.exe   --http-client-body-temp-path=temp/client_body_temp   --http-proxy-temp-path=temp/proxy_temp   --http-fastcgi-temp-path=temp/fastcgi_temp   --with-cc-opt=-dfd_setsize=1024   --with-pcre=objs.msvc8/lib/pcre-7.9   --with-openssl=objs.msvc8/lib/openssl-0.9.8k   --with-openssl-opt=enable-tlsext   --with-zlib=objs.msvc8/lib/zlib-1.2.3   --with-select_module   --with-http_ssl_module   --with-http_realip_module   --with-http_addition_module   --with-http_sub_module   --with-http_dav_module   --with-http_stub_status_module   --with-http_flv_module   --with-http_gzip_static_module   --with-http_random_index_module   --with-http_secure_link_module   --with-mail   --with-mail_ssl_module   --with-ipv6

see nginx process

  tasklist /fi "imagename eq nginx.exe"

As shown below :

Windows Under the system Nginx How to configure the server

Here we are , I'm sure you're right “Windows Under the system Nginx How to configure the server ” Have a deeper understanding of , You might as well put it into practice ! This is the Yisu cloud website , For more relevant contents, you can enter the relevant channels for inquiry , Pay attention to our , Continue to learn !

copyright notice
author[Billion cloud speed],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291744570919.html

Random recommended