小编Ric*_*sen的帖子

ssl用于nginx服务器配置中的子目录

我有一个启用了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)

ssl nginx

3
推荐指数
1
解决办法
5637
查看次数

git clone获取gh-pages,我希望它能克隆master(来自Github)

有一天我不记得我文件夹的主要工作目录在哪里,所以我决定从github网页上的"git@github.com:"地址克隆项目.

那天我不知道我在做什么,之后在目录中创建了一堆东西.然后我做了git add,git clone和git push,(我忘了怎么做).但现在我在github网站上有一个名为'gh-pages'的分支.我真的希望我没有那个分支,但我确实如此.

今天我找到了我的原始目录,今天我在其中创建了一些内容,并做了一些'添加'和一些'推送'.它进入了主分支(我预期,因为我有点放弃了对另一个奇怪的分支的希望).但我现在的问题是:

当我的用户(我自己在另一台机器上尝试过这个)使用github在我项目的主页上给我的地址做一个git克隆时,他们出于某些奇怪的原因最终得到了来自'gh-pages'的代码科.

Q1:我如何让他们做一个git克隆,以便他们可以获得我今天工作的东西(在master分支中).
Q2:如何从github网站中删除'gh-pages'分支?我决定放弃它.如果你有更好的建议,我也会接受.Q3:如果你能告诉我之前我应该​​做些什么,一旦我意识到我的电脑上有两个地方,我的项目在github上有两个独立分支的代码.

git github github-pages

3
推荐指数
1
解决办法
3776
查看次数

宏观扩张:引用身体形式与否?

我很难理解宏扩展是如何工作的.elisp解释器如何处理这两段代码有什么不同?

(defmacro foo (arg)
  (message "arg is: %s" arg))
(foo "bar")
Run Code Online (Sandbox Code Playgroud)

和:

(defmacro foo (arg)
  `(message "arg is: %s" ,arg))
(foo "bar")
Run Code Online (Sandbox Code Playgroud)

emacs elisp emacs24

3
推荐指数
1
解决办法
172
查看次数

如何计算有符号位字段的最大支持值?

假设我的项目包含来自第三方库的标题,其中包含:

struct foo {
    signed int x:4;
};
Run Code Online (Sandbox Code Playgroud)

如果不假设位字段总是具有宽度4,并且不依赖于实现定义的行为,那么如何确定可以存储在成员中的最大值x

c c99 bit-fields c11

3
推荐指数
1
解决办法
930
查看次数

字节编译宏时,"返回的值未使用"警告

为什么字节编译以下会产生警告?

(defmacro foomacro (shiftcode)
  `(defun foo (&optional arg)
     (interactive ,(concat shiftcode "p"))
     (message "arg is %i" arg))
  `(defun bar (&optional arg)
     (interactive ,(concat shiftcode "Nenter a number: "))
     (message "arg is %i" arg)))
;; provide backward compatibility for Emacs 22
(if (fboundp 'handle-shift-selection)
    (foomacro "^")
  (foomacro ""))
Run Code Online (Sandbox Code Playgroud)

这是我收到的警告:

$ emacs -Q --batch --eval '(byte-compile-file "foo.el")'

In foomacro:
foo.el:1:21:Warning: value returned from (concat shiftcode "p") is unused
Run Code Online (Sandbox Code Playgroud)

如果我摆脱bar,警告就会消失:

(defmacro foomacro (shiftcode)
  `(defun foo (&optional arg)
     (interactive ,(concat shiftcode "p")) …
Run Code Online (Sandbox Code Playgroud)

emacs elisp compiler-warnings emacs24

2
推荐指数
1
解决办法
271
查看次数

标签 统计

elisp ×2

emacs ×2

emacs24 ×2

bit-fields ×1

c ×1

c11 ×1

c99 ×1

compiler-warnings ×1

git ×1

github ×1

github-pages ×1

nginx ×1

ssl ×1