我正在重组网址结构.我需要为特定网址设置重定向规则 - 我正在使用NGINX.
基本上是这样的:
http://example.com/issue1 --> http://example.com/shop/issues/custom_issue_name1
http://example.com/issue2 --> http://example.com/shop/issues/custom_issue_name2
http://example.com/issue3 --> http://example.com/shop/issues/custom_issue_name3
Run Code Online (Sandbox Code Playgroud)
谢谢!
我有一个启用了ssl的nginx服务器.目前我已为所有目录启用了https.如何只为www.example.com/shop/*目录启用ssl 而对其他启用禁用?
这是我的conf文件:
# Redirect everything to the main site.
server {
server_name *.example.com;
listen 80;
ssl on;
ssl_certificate /opt/nginx/conf/server.crt;
ssl_certificate_key /opt/nginx/conf/server.key;
keepalive_timeout 70;
access_log /home/example/nginx_logs/access.log ;
error_log /home/example/nginx_logs/error.log ;
root /home/example/public_html/example.com;
location ~ \.php$ {
try_files $uri $uri/ /index.php?q=$uri&$args;
root /home/example/public_html/example.com/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /opt/nginx/conf/fastcgi_params;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /home/example/public_html/example.com$fastcgi_script_name;
index index.php index.html index.htm;
}
if ($http_host != "example.com") {
rewrite ^ http://example.com$request_uri permanent;
}
include global/restrictions.conf;
# Additional rules go …Run Code Online (Sandbox Code Playgroud) 我有一个空的h2元素width=0.之后我用JavaScript在h2中添加了一些内容.如何获得h2元素的新宽度?
之前:<h2></h2>,然后我做$('h2').html('hello');,然后我有:<h2>hello</h2>.