広告が嫌いですか? 行く 広告なし 今日

NGINX サーバーブロックジェネレーター

開発者ネットワーキング

サーバ

Primary domain for this server block.
Optional. Space-separated additional server names.

モード

Space-separated list.
Backend service the proxy forwards to.

TCPハンドシェイクです。

Extras

ガイド

NGINX Server Block Generator

NGINX サーバーブロックジェネレーター

Build a ready-to-paste NGINX server block from a simple form. Pick a port, choose between serving static files or proxying to a backend, and toggle SSL, HTTP/2, gzip, and an HTTP-to-HTTPS redirect. The output updates as you type and is safe to drop straight into /etc/nginx/sites-available/ on most distributions.

使用方法

  1. Enter the primary Server Name (for example example.com) and any extra aliases such as www.example.com.
  2. Pick the Listen Port — typically 80 for HTTP. The port is auto-replaced with 443 ssl when SSL is enabled.
  3. [ブラウザのchrome]を選択し、 モード: Static files reveals document root and index file fields, while Reverse proxy reveals an upstream URL field with optional WebSocket header forwarding.
  4. トグル Enable SSL to add certificate paths, HTTP/2, and an automatic HTTP-to-HTTPS redirect block.
  5. Adjust Extras like gzip compression, client max body size, and access/error log paths.
  6. を使用して、よく使用されるヘッダーをデフォルト値とともに挿入します。認証セクションで認証タイプと認証情報を設定し、カスタムヘッダーを手動で追加します。curl、Postman、またはコードで使用するための完全なヘッダーセットをコピーします。 コピー または ダウンロード buttons on the output to grab the configuration.

機能

  • Static or reverse proxy mode – Switch between serving files from a document root and forwarding requests to an upstream service.
  • SSL helpers – One toggle adds ssl_certificate, ssl_certificate_key, modern TLS protocols, optional HTTP/2, and a separate HTTP-to-HTTPS redirect server block.
  • WebSocket-aware proxy – Reverse proxy mode can emit the UpgradeConnection headers required by WebSocket and Server-Sent Events backends.
  • Production-safe defaults – Sensible X-Forwarded-* headers, gzip MIME types, IPv6 listener, and configurable client_max_body_size, access log, and error log paths.
  • ライブプレビュー – Output regenerates automatically on every input change, with copy and download buttons for quick deployment.

よくある質問

  1. What is an NGINX server block?

    A server block is the NGINX equivalent of an Apache virtual host. It groups directives that decide how NGINX answers a request for a specific host name and port: which files to serve, where to proxy traffic, what TLS certificate to use, and which logs to write. NGINX matches an incoming request to a server block by comparing its Host header and listening socket to the block's server_namelisten ") ディレクティブを正しくフォーマットします。

  2. How does NGINX choose between static files and reverse proxy?

    The behavior is decided per location. A static-file location uses root がほとんどのケースをカバーします。CIでのリグレッションテストには、 try_filesindex to look up files on disk; a reverse-proxy location uses proxy_pass to forward the request to another address over HTTP. NGINX itself does not auto-detect intent — you pick the mode by writing the appropriate directives, and NGINX simply runs whichever block matches the request URI.

  3. Why use HTTP/2 instead of HTTP/1.1?

    HTTP/2 multiplexes many parallel requests over a single TCP connection, sends headers in a compressed binary form (HPACK), and supports server push. In practice this reduces head-of-line blocking and lowers latency for pages that load many resources from the same origin. HTTP/2 also requires TLS in browsers, which is why it is enabled together with SSL on the same listener.

  4. What does gzip compression actually compress?

    NGINX's gzip module compresses outgoing response bodies before they leave the server, using DEFLATE with a configurable level. It is most effective on text-like MIME types — HTML, CSS, JavaScript, JSON, XML, SVG — and is a no-op on already-compressed formats like JPEG, PNG, or video. NGINX advertises support to clients via the Vary: Accept-Encoding header so caches can store both compressed and uncompressed copies.

  5. What is the role of X-Forwarded-For when proxying?

    When a request passes through a reverse proxy, the upstream service sees the proxy's IP as the client. The X-Forwarded-For header preserves the original chain of client addresses, and X-Real-IP records just the immediate client. Together with X-Forwarded-Proto, they let the backend reconstruct who the real visitor is and whether they connected over HTTPS, which is essential for accurate rate limiting, access control, and analytics.

広告なしで楽しみたいですか? 今すぐ広告なしで

拡張機能をインストールする

お気に入りのブラウザにIOツールを追加して、すぐにアクセスし、検索を高速化します。

に追加 Chrome拡張機能 に追加 エッジ拡張 に追加 Firefox 拡張機能 に追加 Opera 拡張機能

スコアボードが到着しました!

スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!

ニュースコーナー 技術ハイライト付き

参加する

価値ある無料ツールの提供を継続するためにご協力ください

コーヒーを買って