理解 Nginx 指令和上下文

type
status
date
slug
summary
tags
category
icon
password

第一個配置文件

理解 NGINX 中的指令和上下文

根據你第一個配置文件內容雖然只有幾行程式碼看起來很簡單,但卻介紹了 NGINX 設定檔的兩個最重要的術語。它們是指令上下文
從技術上講,NGINX 設定檔中的所有內容都是指令。指令有兩種類型:
  • 簡單指令
  • 區塊指令
 
一個簡單的指令由指令名稱和空格分隔的參數組成,例如listenreturn等。簡單指令以分號終止。
 
{ }區塊指令與簡單指令類似,不同之處在於它們不是以分號結尾,而是以一對包含附加指令的大括號結尾。
 
能夠在其中包含其他指令的區塊指令稱為上下文,即eventshttp等等。 NGINX 有四個核心上下文:
  • events { }
    • 用於設定有關 NGINX 如何處理一般層級請求的全域配置
      有效的設定檔中只能有一個 events 區塊
  • http { }
    • 用於定義有關伺服器如何處理 HTTP 和 HTTPS 請求的配置
      有效的設定檔中只能有一個 http 區塊
  • server { }
    • server 區塊會配置在 http 區塊中,用於配置單一主機內的特定虛擬伺服器。
      有效設定檔中可以有多個 server 區塊
      每個 server 區塊都被視為一個虛擬主機
  • main
    • 在前面提到的三個區塊之外編寫的任何內容都算在 main 區塊

官網指令索引文件

Alphabetical index of directives
absolute_redirectaccept_mutexaccept_mutex_delayaccess_log (ngx_http_log_module)access_log (ngx_stream_log_module)add_after_bodyadd_before_bodyadd_headeradd_traileraddition_typesaioaio_writealiasallow (ngx_http_access_module)allow (ngx_stream_access_module)ancient_browserancient_browser_valueapiauth_basicauth_basic_user_fileauth_delayauth_httpauth_http_headerauth_http_pass_client_certauth_http_timeoutauth_jwtauth_jwt_claim_setauth_jwt_header_setauth_jwt_key_cacheauth_jwt_key_fileauth_jwt_key_requestauth_jwt_leewayauth_jwt_requireauth_jwt_typeauth_requestauth_request_setautoindexautoindex_exact_sizeautoindex_formatautoindex_localtimebreakcharsetcharset_mapcharset_typeschunked_transfer_encodingclient_body_buffer_sizeclient_body_in_file_onlyclient_body_in_single_bufferclient_body_temp_pathclient_body_timeoutclient_header_buffer_sizeclient_header_timeoutclient_max_body_sizeconnect_timeoutconnection_pool_sizecreate_full_put_pathdaemondav_accessdav_methodsdebug_connectiondebug_pointsdefault_typedeny (ngx_http_access_module)deny (ngx_stream_access_module)directiodirectio_alignmentdisable_symlinksempty_gifenverror_logerror_pageetageventsexpiresf4ff4f_buffer_sizefastcgi_bindfastcgi_buffer_sizefastcgi_bufferingfastcgi_buffersfastcgi_busy_buffers_sizefastcgi_cachefastcgi_cache_background_updatefastcgi_cache_bypassfastcgi_cache_keyfastcgi_cache_lockfastcgi_cache_lock_agefastcgi_cache_lock_timeoutfastcgi_cache_max_range_offsetfastcgi_cache_methodsfastcgi_cache_min_usesfastcgi_cache_pathfastcgi_cache_purgefastcgi_cache_revalidatefastcgi_cache_use_stalefastcgi_cache_validfastcgi_catch_stderrfastcgi_connect_timeoutfastcgi_force_rangesfastcgi_hide_headerfastcgi_ignore_client_abortfastcgi_ignore_headersfastcgi_indexfastcgi_intercept_errorsfastcgi_keep_connfastcgi_limit_ratefastcgi_max_temp_file_sizefastcgi_next_upstreamfastcgi_next_upstream_timeoutfastcgi_next_upstream_triesfastcgi_no_cachefastcgi_paramfastcgi_passfastcgi_pass_headerfastcgi_pass_request_bodyfastcgi_pass_request_headersfastcgi_read_timeoutfastcgi_request_bufferingfastcgi_send_lowatfastcgi_send_timeoutfastcgi_socket_keepalivefastcgi_split_path_infofastcgi_storefastcgi_store_accessfastcgi_temp_file_write_sizefastcgi_temp_pathflvgeo (ngx_http_geo_module)geo (ngx_stream_geo_module)geoip_city (ngx_http_geoip_module)geoip_city (ngx_stream_geoip_module)geoip_country (ngx_http_geoip_module)geoip_country (ngx_stream_geoip_module)geoip_org (ngx_http_geoip_module)geoip_org (ngx_stream_geoip_module)geoip_proxygeoip_proxy_recursivegoogle_perftools_profilesgrpc_bindgrpc_buffer_sizegrpc_connect_timeoutgrpc_hide_headergrpc_ignore_headersgrpc_intercept_errorsgrpc_next_upstreamgrpc_next_upstream_timeoutgrpc_next_upstream_triesgrpc_passgrpc_pass_headergrpc_read_timeoutgrpc_send_timeoutgrpc_set_headergrpc_socket_keepalivegrpc_ssl_certificategrpc_ssl_certificate_keygrpc_ssl_ciphersgrpc_ssl_conf_commandgrpc_ssl_crlgrpc_ssl_namegrpc_ssl_password_filegrpc_ssl_protocolsgrpc_ssl_server_namegrpc_ssl_session_reusegrpc_ssl_trusted_certificategrpc_ssl_verifygrpc_ssl_verify_depthgunzipgunzip_buffersgzipgzip_buffersgzip_comp_levelgzip_disablegzip_http_versiongzip_min_lengthgzip_proxiedgzip_staticgzip_typesgzip_varyhash (ngx_http_upstream_module)hash (ngx_stream_upstream_module)health_check (ngx_http_upstream_hc_module)health_check (ngx_stream_upstream_hc_module)health_check_timeouthlshls_buffershls_forward_argshls_fragmenthls_mp4_buffer_sizehls_mp4_max_buffer_sizehttphttp2http2_body_preread_sizehttp2_chunk_sizehttp2_idle_timeouthttp2_max_concurrent_pusheshttp2_max_concurrent_streamshttp2_max_field_sizehttp2_max_header_sizehttp2_max_requestshttp2_pushhttp2_push_preloadhttp2_recv_buffer_sizehttp2_recv_timeouthttp3http3_hqhttp3_max_concurrent_streamshttp3_stream_buffer_sizeifif_modified_sinceignore_invalid_headersimage_filterimage_filter_bufferimage_filter_interlaceimage_filter_jpeg_qualityimage_filter_sharpenimage_filter_transparencyimage_filter_webp_qualityimap_authimap_capabilitiesimap_client_bufferincludeindexinternalinternal_redirectip_hashjs_accessjs_body_filterjs_contentjs_fetch_buffer_size (ngx_http_js_module)js_fetch_buffer_size (ngx_stream_js_module)js_fetch_ciphers (ngx_http_js_module)js_fetch_ciphers (ngx_stream_js_module)js_fetch_max_response_buffer_size (ngx_http_js_module)js_fetch_max_response_buffer_size (ngx_stream_js_module)js_fetch_protocols (ngx_http_js_module)js_fetch_protocols (ngx_stream_js_module)js_fetch_timeout (ngx_http_js_module)js_fetch_timeout (ngx_stream_js_module)js_fetch_trusted_certificate (ngx_http_js_module)js_fetch_trusted_certificate (ngx_stream_js_module)js_fetch_verify (ngx_http_js_module)js_fetch_verify (ngx_stream_js_module)js_fetch_verify_depth (ngx_http_js_module)js_fetch_verify_depth (ngx_stream_js_module)js_filterjs_header_filterjs_import (ngx_http_js_module)js_import (ngx_stream_js_module)js_include (ngx_http_js_module)js_include (ngx_stream_js_module)js_path (ngx_http_js_module)js_path (ngx_stream_js_module)js_periodic (ngx_http_js_module)js_periodic (ngx_stream_js_module)js_preload_object (ngx_http_js_module)js_preload_object (ngx_stream_js_module)js_prereadjs_set (ngx_http_js_module)js_set (ngx_stream_js_module)js_shared_dict_zone (ngx_http_js_module)js_shared_dict_zone (ngx_stream_js_module)js_var (ngx_http_js_module)js_var (ngx_stream_js_module)keepalivekeepalive_disablekeepalive_requests (ngx_http_core_module)keepalive_requests (ngx_http_upstream_module)keepalive_time (ngx_http_core_module)keepalive_time (ngx_http_upstream_module)keepalive_timeout (ngx_http_core_module)keepalive_timeout (ngx_http_upstream_module)keyval (ngx_http_keyval_module)keyval (ngx_stream_keyval_module)keyval_zone (ngx_http_keyval_module)keyval_zone (ngx_stream_keyval_module)large_client_header_buffersleast_conn (ngx_http_upstream_module)least_conn (ngx_stream_upstream_module)least_time (ngx_http_upstream_module)least_time (ngx_stream_upstream_module)limit_conn (ngx_http_limit_conn_module)limit_conn (ngx_stream_limit_conn_module)limit_conn_dry_run (ngx_http_limit_conn_module)limit_conn_dry_run (ngx_stream_limit_conn_module)limit_conn_log_level (ngx_http_limit_conn_module)limit_conn_log_level (ngx_stream_limit_conn_module)limit_conn_statuslimit_conn_zone (ngx_http_limit_conn_module)limit_conn_zone (ngx_stream_limit_conn_module)limit_exceptlimit_ratelimit_rate_afterlimit_reqlimit_req_dry_runlimit_req_log_levellimit_req_statuslimit_req_zonelimit_zonelingering_closelingering_timelingering_timeoutlisten (ngx_http_core_module)listen (ngx_mail_core_module)listen (ngx_stream_core_module)load_modulelocationlock_filelog_format (ngx_http_log_module)log_format (ngx_stream_log_module)log_not_foundlog_subrequestmailmap (ngx_http_map_module)map (ngx_stream_map_module)map_hash_bucket_size (ngx_http_map_module)map_hash_bucket_size (ngx_stream_map_module)map_hash_max_size (ngx_http_map_module)map_hash_max_size (ngx_stream_map_module)master_processmatch (ngx_http_upstream_hc_module)match (ngx_stream_upstream_hc_module)max_errorsmax_rangesmemcached_bindmemcached_buffer_sizememcached_connect_timeoutmemcached_gzip_flagmemcached_next_upstreammemcached_next_upstream_timeoutmemcached_next_upstream_triesmemcached_passmemcached_read_timeoutmemcached_send_timeoutmemcached_socket_keepalivemerge_slashesmgmtmin_delete_depthmirrormirror_request_bodymodern_browsermodern_browser_valuemp4mp4_buffer_sizemp4_limit_ratemp4_limit_rate_aftermp4_max_buffer_sizemp4_start_key_framemqttmqtt_buffersmqtt_prereadmqtt_rewrite_buffer_sizemqtt_set_connectmsie_paddingmsie_refreshmulti_acceptntlmopen_file_cacheopen_file_cache_errorsopen_file_cache_min_usesopen_file_cache_validopen_log_file_cache (ngx_http_log_module)open_log_file_cache (ngx_stream_log_module)otel_exporterotel_service_nameotel_span_attrotel_span_nameotel_traceotel_trace_contextoutput_buffersoverride_charsetpasspcre_jitperlperl_modulesperl_requireperl_setpidpop3_authpop3_capabilitiesport_in_redirectpostpone_outputpreread_buffer_sizepreread_timeoutprotocolproxy_bind (ngx_http_proxy_module)proxy_bind (ngx_stream_proxy_module)proxy_bufferproxy_buffer_size (ngx_http_proxy_module)proxy_buffer_size (ngx_stream_proxy_module)proxy_bufferingproxy_buffersproxy_busy_buffers_sizeproxy_cacheproxy_cache_background_updateproxy_cache_bypassproxy_cache_convert_headproxy_cache_keyproxy_cache_lockproxy_cache_lock_ageproxy_cache_lock_timeoutproxy_cache_max_range_offsetproxy_cache_methodsproxy_cache_min_usesproxy_cache_pathproxy_cache_purgeproxy_cache_revalidateproxy_cache_use_staleproxy_cache_validproxy_connect_timeout (ngx_http_proxy_module)proxy_connect_timeout (ngx_stream_proxy_module)proxy_cookie_domainproxy_cookie_flagsproxy_cookie_pathproxy_download_rateproxy_force_rangesproxy_half_closeproxy_headers_hash_bucket_sizeproxy_headers_hash_max_sizeproxy_hide_headerproxy_http_versionproxy_ignore_client_abortproxy_ignore_headersproxy_intercept_errorsproxy_limit_rateproxy_max_temp_file_sizeproxy_methodproxy_next_upstream (ngx_http_proxy_module)proxy_next_upstream (ngx_stream_proxy_module)proxy_next_upstream_timeout (ngx_http_proxy_module)proxy_next_upstream_timeout (ngx_stream_proxy_module)proxy_next_upstream_tries (ngx_http_proxy_module)proxy_next_upstream_tries (ngx_stream_proxy_module)proxy_no_cacheproxy_pass (ngx_http_proxy_module)proxy_pass (ngx_stream_proxy_module)proxy_pass_error_messageproxy_pass_headerproxy_pass_request_bodyproxy_pass_request_headersproxy_protocol (ngx_mail_proxy_module)proxy_protocol (ngx_stream_proxy_module)proxy_protocol_timeoutproxy_read_timeoutproxy_redirectproxy_request_bufferingproxy_requestsproxy_responsesproxy_send_lowatproxy_send_timeoutproxy_session_dropproxy_set_bodyproxy_set_headerproxy_smtp_authproxy_socket_keepalive (ngx_http_proxy_module)proxy_socket_keepalive (ngx_stream_proxy_module)proxy_sslproxy_ssl_certificate (ngx_http_proxy_module)proxy_ssl_certificate (ngx_stream_proxy_module)proxy_ssl_certificate_key (ngx_http_proxy_module)proxy_ssl_certificate_key (ngx_stream_proxy_module)proxy_ssl_ciphers (ngx_http_proxy_module)proxy_ssl_ciphers (ngx_stream_proxy_module)proxy_ssl_conf_command (ngx_http_proxy_module)proxy_ssl_conf_command (ngx_stream_proxy_module)proxy_ssl_crl (ngx_http_proxy_module)proxy_ssl_crl (ngx_stream_proxy_module)proxy_ssl_name (ngx_http_proxy_module)proxy_ssl_name (ngx_stream_proxy_module)proxy_ssl_password_file (ngx_http_proxy_module)proxy_ssl_password_file (ngx_stream_proxy_module)proxy_ssl_protocols (ngx_http_proxy_module)proxy_ssl_protocols (ngx_stream_proxy_module)proxy_ssl_server_name (ngx_http_proxy_module)proxy_ssl_server_name (ngx_stream_proxy_module)proxy_ssl_session_reuse (ngx_http_proxy_module)proxy_ssl_session_reuse (ngx_stream_proxy_module)proxy_ssl_trusted_certificate (ngx_http_proxy_module)proxy_ssl_trusted_certificate (ngx_stream_proxy_module)proxy_ssl_verify (ngx_http_proxy_module)proxy_ssl_verify (ngx_stream_proxy_module)proxy_ssl_verify_depth (ngx_http_proxy_module)proxy_ssl_verify_depth (ngx_stream_proxy_module)proxy_storeproxy_store_accessproxy_temp_file_write_sizeproxy_temp_pathproxy_timeout (ngx_mail_proxy_module)proxy_timeout (ngx_stream_proxy_module)proxy_upload_ratequeuequic_active_connection_id_limitquic_bpfquic_gsoquic_host_keyquic_retryrandom (ngx_http_upstream_module)random (ngx_stream_upstream_module)random_indexread_aheadread_timeoutreal_ip_headerreal_ip_recursiverecursive_error_pagesreferer_hash_bucket_sizereferer_hash_max_sizerequest_pool_sizereset_timedout_connectionresolver (ngx_http_core_module)resolver (ngx_http_upstream_module)resolver (ngx_mail_core_module)resolver (ngx_stream_core_module)resolver (ngx_stream_upstream_module)resolver (ngx_mgmt_module)resolver_timeout (ngx_http_core_module)resolver_timeout (ngx_http_upstream_module)resolver_timeout (ngx_mail_core_module)resolver_timeout (ngx_stream_core_module)resolver_timeout (ngx_stream_upstream_module)resolver_timeout (ngx_mgmt_module)return (ngx_http_rewrite_module)return (ngx_stream_return_module)rewriterewrite_logrootsatisfyscgi_bindscgi_buffer_sizescgi_bufferingscgi_buffersscgi_busy_buffers_sizescgi_cachescgi_cache_background_updatescgi_cache_bypassscgi_cache_keyscgi_cache_lockscgi_cache_lock_agescgi_cache_lock_timeoutscgi_cache_max_range_offsetscgi_cache_methodsscgi_cache_min_usesscgi_cache_pathscgi_cache_purgescgi_cache_revalidatescgi_cache_use_stalescgi_cache_validscgi_connect_timeoutscgi_force_rangesscgi_hide_headerscgi_ignore_client_abortscgi_ignore_headersscgi_intercept_errorsscgi_limit_ratescgi_max_temp_file_sizescgi_next_upstreamscgi_next_upstream_timeoutscgi_next_upstream_triesscgi_no_cachescgi_paramscgi_passscgi_pass_headerscgi_pass_request_bodyscgi_pass_request_headersscgi_read_timeoutscgi_request_bufferingscgi_send_timeoutscgi_socket_keepalivescgi_storescgi_store_accessscgi_temp_file_write_sizescgi_temp_pathsecure_linksecure_link_md5secure_link_secretsend_lowatsend_timeout (ngx_http_core_module)send_timeout (ngx_mgmt_module)sendfilesendfile_max_chunkserver (ngx_http_core_module)server (ngx_http_upstream_module)server (ngx_mail_core_module)server (ngx_stream_core_module)server (ngx_stream_upstream_module)server_name (ngx_http_core_module)server_name (ngx_mail_core_module)server_name (ngx_stream_core_module)server_name_in_redirectserver_names_hash_bucket_size (ngx_http_core_module)server_names_hash_bucket_size (ngx_stream_core_module)server_names_hash_max_size (ngx_http_core_module)server_names_hash_max_size (ngx_stream_core_module)server_tokenssession_logsession_log_formatsession_log_zoneset (ngx_http_rewrite_module)set (ngx_stream_set_module)set_real_ip_from (ngx_http_realip_module)set_real_ip_from (ngx_mail_realip_module)set_real_ip_from (ngx_stream_realip_module)slicesmtp_authsmtp_capabilitiessmtp_client_buffersmtp_greeting_delaysource_charsetsplit_clients (ngx_http_split_clients_module)split_clients (ngx_stream_split_clients_module)ssissi_last_modifiedssi_min_file_chunkssi_silent_errorsssi_typesssi_value_lengthssl (ngx_http_ssl_module)ssl (ngx_mail_ssl_module)ssl (ngx_mgmt_module)ssl_alpnssl_buffer_sizessl_certificate (ngx_http_ssl_module)ssl_certificate (ngx_mail_ssl_module)ssl_certificate (ngx_stream_ssl_module)ssl_certificate (ngx_mgmt_module)ssl_certificate_key (ngx_http_ssl_module)ssl_certificate_key (ngx_mail_ssl_module)ssl_certificate_key (ngx_stream_ssl_module)ssl_certificate_key (ngx_mgmt_module)ssl_ciphers (ngx_http_ssl_module)ssl_ciphers (ngx_mail_ssl_module)ssl_ciphers (ngx_stream_ssl_module)ssl_ciphers (ngx_mgmt_module)ssl_client_certificate (ngx_http_ssl_module)ssl_client_certificate (ngx_mail_ssl_module)ssl_client_certificate (ngx_stream_ssl_module)ssl_conf_command (ngx_http_ssl_module)ssl_conf_command (ngx_mail_ssl_module)ssl_conf_command (ngx_stream_ssl_module)ssl_crl (ngx_http_ssl_module)ssl_crl (ngx_mail_ssl_module)ssl_crl (ngx_stream_ssl_module)ssl_crl (ngx_mgmt_module)ssl_dhparam (ngx_http_ssl_module)ssl_dhparam (ngx_mail_ssl_module)ssl_dhparam (ngx_stream_ssl_module)ssl_early_datassl_ecdh_curve (ngx_http_ssl_module)ssl_ecdh_curve (ngx_mail_ssl_module)ssl_ecdh_curve (ngx_stream_ssl_module)ssl_enginessl_handshake_timeoutssl_namessl_ocspssl_ocsp_cachessl_ocsp_responderssl_password_file (ngx_http_ssl_module)ssl_password_file (ngx_mail_ssl_module)ssl_password_file (ngx_stream_ssl_module)ssl_password_file (ngx_mgmt_module)ssl_prefer_server_ciphers (ngx_http_ssl_module)ssl_prefer_server_ciphers (ngx_mail_ssl_module)ssl_prefer_server_ciphers (ngx_stream_ssl_module)ssl_prereadssl_protocols (ngx_http_ssl_module)ssl_protocols (ngx_mail_ssl_module)ssl_protocols (ngx_stream_ssl_module)ssl_protocols (ngx_mgmt_module)ssl_reject_handshake (ngx_http_ssl_module)ssl_reject_handshake (ngx_stream_ssl_module)ssl_server_namessl_session_cache (ngx_http_ssl_module)ssl_session_cache (ngx_mail_ssl_module)ssl_session_cache (ngx_stream_ssl_module)ssl_session_ticket_key (ngx_http_ssl_module)ssl_session_ticket_key (ngx_mail_ssl_module)ssl_session_ticket_key (ngx_stream_ssl_module)ssl_session_tickets (ngx_http_ssl_module)ssl_session_tickets (ngx_mail_ssl_module)ssl_session_tickets (ngx_stream_ssl_module)ssl_session_timeout (ngx_http_ssl_module)ssl_session_timeout (ngx_mail_ssl_module)ssl_session_timeout (ngx_stream_ssl_module)ssl_staplingssl_stapling_filessl_stapling_responderssl_stapling_verifyssl_trusted_certificate (ngx_http_ssl_module)ssl_trusted_certificate (ngx_mail_ssl_module)ssl_trusted_certificate (ngx_stream_ssl_module)ssl_trusted_certificate (ngx_mgmt_module)ssl_verifyssl_verify_client (ngx_http_ssl_module)ssl_verify_client (ngx_mail_ssl_module)ssl_verify_client (ngx_stream_ssl_module)ssl_verify_depth (ngx_http_ssl_module)ssl_verify_depth (ngx_mail_ssl_module)ssl_verify_depth (ngx_stream_ssl_module)ssl_verify_depth (ngx_mgmt_module)starttlsstate (ngx_http_upstream_module)state (ngx_stream_upstream_module)statusstatus_formatstatus_zone (ngx_http_api_module)status_zone (ngx_http_status_module)stickysticky_cookie_insertstreamstub_statussub_filtersub_filter_last_modifiedsub_filter_oncesub_filter_typessubrequest_output_buffer_sizetcp_nodelay (ngx_http_core_module)tcp_nodelay (ngx_stream_core_module)tcp_nopushthread_pooltimeouttimer_resolutiontry_filestypestypes_hash_bucket_sizetypes_hash_max_sizeunderscores_in_headersuninitialized_variable_warnupstream (ngx_http_upstream_module)upstream (ngx_stream_upstream_module)upstream_confusage_reportuseuseruseriduserid_domainuserid_expiresuserid_flagsuserid_markuserid_nameuserid_p3puserid_pathuserid_serviceuuid_fileuwsgi_binduwsgi_buffer_sizeuwsgi_bufferinguwsgi_buffersuwsgi_busy_buffers_sizeuwsgi_cacheuwsgi_cache_background_updateuwsgi_cache_bypassuwsgi_cache_keyuwsgi_cache_lockuwsgi_cache_lock_ageuwsgi_cache_lock_timeoutuwsgi_cache_max_range_offsetuwsgi_cache_methodsuwsgi_cache_min_usesuwsgi_cache_pathuwsgi_cache_purgeuwsgi_cache_revalidateuwsgi_cache_use_staleuwsgi_cache_validuwsgi_connect_timeoutuwsgi_force_rangesuwsgi_hide_headeruwsgi_ignore_client_abortuwsgi_ignore_headersuwsgi_intercept_errorsuwsgi_limit_rateuwsgi_max_temp_file_sizeuwsgi_modifier1uwsgi_modifier2uwsgi_next_upstreamuwsgi_next_upstream_timeoutuwsgi_next_upstream_triesuwsgi_no_cacheuwsgi_paramuwsgi_passuwsgi_pass_headeruwsgi_pass_request_bodyuwsgi_pass_request_headersuwsgi_read_timeoutuwsgi_request_bufferinguwsgi_send_timeoutuwsgi_socket_keepaliveuwsgi_ssl_certificateuwsgi_ssl_certificate_keyuwsgi_ssl_ciphersuwsgi_ssl_conf_commanduwsgi_ssl_crluwsgi_ssl_nameuwsgi_ssl_password_fileuwsgi_ssl_protocolsuwsgi_ssl_server_nameuwsgi_ssl_session_reuseuwsgi_ssl_trusted_certificateuwsgi_ssl_verifyuwsgi_ssl_verify_depthuwsgi_storeuwsgi_store_accessuwsgi_temp_file_write_sizeuwsgi_temp_pathvalid_referersvariables_hash_bucket_size (ngx_http_core_module)variables_hash_bucket_size (ngx_stream_core_module)variables_hash_max_size (ngx_http_core_module)variables_hash_max_size (ngx_stream_core_module)worker_aio_requestsworker_connectionsworker_cpu_affinityworker_priorityworker_processesworker_rlimit_coreworker_rlimit_nofileworker_shutdown_timeoutworking_directoryxclientxml_entitiesxslt_last_modifiedxslt_paramxslt_string_paramxslt_stylesheetxslt_typeszone (ngx_http_upstream_module)zone (ngx_stream_upstream_module)zone_synczone_sync_bufferszone_sync_connect_retry_intervalzone_sync_connect_timeoutzone_sync_intervalzone_sync_recv_buffer_sizezone_sync_serverzone_sync_sslzone_sync_ssl_certificatezone_sync_ssl_certificate_keyzone_sync_ssl_cipherszone_sync_ssl_conf_commandzone_sync_ssl_crlzone_sync_ssl_namezone_sync_ssl_password_filezone_sync_ssl_protocolszone_sync_ssl_server_namezone_sync_ssl_trusted_certificatezone_sync_ssl_verifyzone_sync_ssl_verify_depthzone_sync_timeout

配置多個 server

在瀏覽器請求 http://nginx-handbook.test:80 畫面會顯示 hello from port 80!
在瀏覽器請求 http://nginx-handbook.test:8080 畫面會顯示 hello from port 8080!

參考文章

安裝 Nginx使用 Nginx 提供靜態內容
Loading...
目錄