小编Ric*_*tta的帖子

Nginx server_name regexp不能用作变量

有谁告诉我为什么我仍然会出现这样的错误?

Restarting nginx: [emerg]: unknown "domain_name" variable
configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)

代码的变量部分如下所示:

server {
    # if you're running multiple servers, instead of "default" you should
    # put your main domain name here
    listen 80 default;

    # you could put a list of other domain names this application answers
    server_name ^~(?<domain_name>[^\.]*)\.(?<tld>[^\.]*)$;

    # root defined by domain
    root /home/deployer/apps/$domain_name/current/;

    # access && error && rewrite log
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    rewrite_log on;

    # default location
    location / {

...
Run Code Online (Sandbox Code Playgroud)

regex configuration http nginx

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

单词javascript中的普通

有没有什么优雅的方法如何在js/coffee中以单词格式获得序数?像这样的东西:

ordinalInWord(1) # => "first"
ordinalInWord(2) # => "second"
ordinalInWord(5) # => "fifth"
Run Code Online (Sandbox Code Playgroud)

javascript ordinals coffeescript

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

你如何使用hasOwnProperty?

任何人都能解释一下hasOwnProperty在空对象上调用了什么吗?为什么要用它?

__hasProp = {}.hasOwnProperty
Run Code Online (Sandbox Code Playgroud)

当我开始用coffescript开发时,我发现了这一点.Ty

javascript class coffeescript

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

标签 统计

coffeescript ×2

javascript ×2

class ×1

configuration ×1

http ×1

nginx ×1

ordinals ×1

regex ×1