# Define the user that will own and run the Nginx server user nginx; # Define the number of worker processes; recommended value is the number of # cores that are being used by your server worker_processes1;
# Define the location on the file system of the error log, plus the minimum # severity to log messages for error_log /var/log/nginx/error.log warn; # Define the file that will store the process ID of the main NGINX process pid /var/run/nginx.pid;
# events block defines the parameters that affect connection processing. events { # Define the maximum number of simultaneous connections that can be opened by a worker process worker_connections1024; }
# http block defines the parameters for how NGINX should handle HTTP web traffic http { # Include the file defining the list of file types that are supported by NGINX include /etc/nginx/mime.types; # Define the default file type that is returned to the user default_type text/html;
# Define the format of log messages. log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status$body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
# Define the location of the log of access attempts to NGINX access_log /var/log/nginx/access.log main;
# Define the parameters to optimize the delivery of static content sendfileon; tcp_nopushon; tcp_nodelayon;
# Define the timeout value for keep-alive connections with the client keepalive_timeout65;
# Define the usage of the gzip compression algorithm to reduce the amount of data to transmit #gzip on;
# Include additional parameters for virtual host(s)/server(s) include /etc/nginx/conf.d/*.conf; }
# Define the parameters for a specific virtual host/server server { # Define the directory where the contents being requested are stored # root /usr/src/app/project/;
# Define the default page that will be served If no page was requested # (ie. if www.kennedyfamilyrecipes.com is requested) # index index.html;
# Define the server name, IP address, and/or port of the server listen80; # server_name xxx.yyy.zzz.aaa
# Define the specified charset to the “Content-Type” response header field charset utf-8;
# Configure NGINX to deliver static content from the specified folder location /static { alias /usr/src/app/project/static; }
# Configure NGINX to reverse proxy HTTP requests to the upstream server (Gunicorn (WSGI server)) location / { # Define the location of the proxy server to send the request to proxy_pass http://web:8000;
# Redefine the header fields that NGINX sends to the upstream server proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Define the maximum file size on file uploads client_max_body_size5M; } }
样式元素最好用于文档的 head 中。在文档的 body
中使用样式可能导致重复定义样式,触发重布局、导致重绘,因此需要小心使用。
此外还应该注意的是如示例所示,样式不存在作用域。后来在 HTML
文档中定义的内联样式仍然会应用于之前定义的元素,所以它可能会触发重绘。
<legend>
中的标题元素
在表单中,<legend> 元素表示
<fieldset> 表单域中的标题。在 HTML 5.2 前,legend
元素的内容必须为纯文本。而现在,它可以包含标题元素(<h1>等)了。
1 2 3 4 5 6 7 8
<fieldset> <legend><h2>Basic Information</h2></legend> <!-- Form fields for basic information --> </fieldset> <fieldset> <legend><h2>Contact Information</h2></legend> <!-- Form fields for contact information --> </fieldset>